Reputation: 1
I've uploaded my reporte.php and the other files to the server, it works properly on local but now I can't make it work on the server, the routing is right as I've tried exit(); on phpWord.php so it makes no sense to me that it doesn't finds Settings.php as it is exactly in the same directory, here are my files:
function loadLibraries($class){
require_once "/var/www/firescon/public/librerias/PhpOffice/PhpWord/PhpWord.php";
}
spl_autoload_register("loadLibraries");
?>
The rest of the document is the report, it is 2000 lines long and Im pretty sure it is not the problem, but if you want to see something specific just tell me to, thanks a lot :)
<?php
require "/var/www/firescon/public/librerias/autoload.php";
use \PhpOffice\PhpWord\PhpWord;
$phpWord = new PhpWord();
The error happens in the line where $phpWord is declared
Upvotes: 0
Views: 1265
Reputation: 1
Obviously as I later on figured out, $class is mandatory, as it is what gets every \PhpOffice\PhpWord class, the thing is that in server the slashes must be / for me, not \ and $class was getting them like this: , so by doing a str_replace("\","/", $class) and sending that instead of $class you get it right.
Upvotes: 0