how to fix error laravel 5.2 “failed to open stream: No such file or directory” without composer

蹲街弑〆低调 提交于 2020-01-03 06:34:59

问题


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 update and composer 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:

  1. Delete all laravel project in hosting service. I recommend to use smartftp for good speed file access and tracked action.
  2. Back to our localhost project and run composer install --no-scripts command and then composer clearcache.
  3. Reupload all laravel project.
  4. Don't forget to configure .env file.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!