problems like this usually come down to case sensitivity
is PhpWord\Phpword() correct?
Dear All,
I am having a problem using PHPWord and I am hoping someone else has experience of this and can let me know where I am going wrong.
Locally, PHPWord is working absolutely perfectly and producing my files as expected.
My settings are:
In composer.json (shortened)
"require": {
"php": ">=7.0.2",
"laravel/framework": "^5.4.17",
"mpdf/mpdf": "^6.1",
"phpoffice/phpword": "v0.13.0"
},
I can also see in my composer.lock that 'v0.13.0' is being used.
I am using fully qualified class names as per the documentation (although it also works fine importing them).
$doc = new \PhpOffice\PhpWord\Phpword();
When I have deployed to my test server and tried to run the file I am getting this error:
production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'PhpOffice\PhpWord\Phpword' not found in /home/forge/...(myProject)..
Yet when I have checked in the vendor directory on the server, all the files are exactly where you would expect them to be. I have run composer dump-autoload just in case, but no joy.
One more piece of information: elsewhere in my project I have been using mPDF and I can now see PHPStorm saying where I have imported mPDF it is 'undefined' due to a clash with PHPWord's version.
Can anyone suggest what I could try next please?
problems like this usually come down to case sensitivity
is PhpWord\Phpword() correct?
Please or to participate in this conversation.