1
votes

I am deploying Symfony 4 website on a 1&1 server shared hosting. and I am facing an error which I guess is link with the autoload that cannot compile the good path that is given to it.

So it seems that in the first path between "composer" and "symfony", there is "../" to actually leave the composer directory and then go to the symfony one, but it is compiling instead of changing directory.

I transfered my project with Filezilla.

Before the transfer I prepared my project by changing .env to prod and DB connection. But I also executed this command :

composer install --no-dev --optimize-autoloader
composer dump-autoload --optimize --no-dev --classmap-authoritative

Many thanks for your help in advance

The error shown is :

Fatal error: require(): Failed opening required '/homepages/xx/xxxxxxxx/htdocs/snowtricks/vendor/composer/../symfony/phpunit-bridge/bootstrap.php' (include_path='.:/usr/lib/php7.2') in /homepages/xx/xxxxxxx/htdocs/snowtricks/vendor/composer/autoload_real.php on line 66

1
I dont really how it will solve my problem... I dont use any edit, so except if you give me more details about it... I cannot solve it...MaxiGui
please set SYMFONY_ENV to prod and add --no-dev option when installing dependencies by the composer.Mohammad Zare Moghadam
How did you transfer the files to your host? Have you checked if the (read-)permissions are set correctly and the file exists (in vendor/symfony/...)? The phpunit-bridge is usually a dev dependency, should the application run in prod as @MohammadZareMoghadam suggests?dbrumann
I'm not sure if 1&1 shared hosting comes with 'composer' installed. I would suggest that you upload the project with vendor files & folder. If it working on your local machine, it should work on your shared hosting too.Aakash Tushar

1 Answers

1
votes

So I had multiple issues, many thanks for thos who help me in the comments. The first thing to do was to run the command php7.1-cli ../composer.phar dump-autoload --no-devas @Mohammad Zare Moghadam suggest:

please set SYMFONY_ENV to prod and add --no-dev option when installing dependencies by the composer. – Mohammad Zare Moghadam

And then it seems that the files were really missing even if I did the transfer with FileZilla, I must manage every bundle manualy again.

Thanks to @Jakumi for his patient.