问题
I've got this error in my laravel 5.2 project who hosted in debian linux
Warning: require_once(/home/u706561288/public_html/sap/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
Fatal error: require_once(): Failed opening required '/home/u706561288/public_html/sap/vendor/composer/autoload_real.php' (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/u706561288/public_html/sap/vendor/autoload.php on line 5
so many forum like stackoverflow tell me to using php artisan "composer update" but unfortunately my hosting package not available to composer instalation please tell me how to fix this problem
回答1:
I suggest that you test these steps
- On the Localhost, run these two commands (
composer updateandcomposer dump-autoload) - Re-upload the entire project on the server
Also, if the problem is not resolved, you can delete the Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again.
回答2:
When the hosting service or some PC does not allow to install Composer and appears error like in my case, follow these steps:
- Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
- Back to our localhost project and run
composer install --no-scriptscommand and thencomposer clearcache. - Reupload all laravel project.
- Don't forget to configure
.envfile.
I hope this can help with the same problem in future.
回答3:
I had the same error while back, what I did to solve it was. I delete all the vendor folder from the root project then install it back by executing composer install
来源:https://stackoverflow.com/questions/50300159/how-to-fix-error-laravel-5-2-failed-to-open-stream-no-such-file-or-directory