I have deployed a Symfony2 application to shared hosting server from local machine. I used a git pull followed by composer install and then i chmoded the app/cache
and app/logs
permissions to 777.
Each time I run the application I get the following error:
[2016-02-06 18:55:43] request.CRITICAL:
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:
"Compile Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php')" at
/home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultController.php line 5 {"exception":"[object]
(Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile
Error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') at /home/tdarlic/public_html/magniblu/users/src/AppBundle/Controller/DefaultControll er.php:5)"} []
I managed to fix this by entering full path to autoload.php:
require '/home/tdarlic/public_html/magniblu/users/vendor/autoload.php';
I tried with
../../../vendor/autoload.php
and with
../../vendor/autoload.php
require __DIR__.'../../vendor.autoload.php';
and still cannot figure out how to keep the autoload file link loading correctly on development machine and on the server. Any ideas how to solve this?
Similar issue can be found on: Why my autoload.php of composer doesn't work?