After downloading and extracting PHPWord zip files from GITHUB I uploaded these files to my php Server.
But when I try to create a new document by:
$PHPWord = new \PhpOffice\PhpWord\PhpWord(),
I get an error from PhpWord.php:
‘Class PhpOffice\PhpWord\Media not found’.
Same applies for Class “PhpOffice\PhpWord\Style” and several other Classes.
Typically they are all part of the same Namespace: PhpOffice\PhpWord.
Please advize.
Update:
Today I installed PHPWord on my local machine with the Composer. Then I uploaded it to my server and used the autoloader. Problem remains the same. Some files are just not found, although they are in the same directory and share the same Namespace.
I know this topic is a doubling, but I can’t understand the at the time given solution.
(which by the way was: so by doing a str_replace("\","/", $class) and sending that instead of $class you get it right.
).