Alimin
Alimin

Reputation: 2747

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

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

Upvotes: 1

Views: 16456

Answers (5)

Sumin Shrestha
Sumin Shrestha

Reputation: 11

delete the ‍Vendor folder and the composer.lock file and run the composer install command and Re-upload the entire project again

this helped me

Upvotes: 1

Maduka Jayalath
Maduka Jayalath

Reputation: 1723

If anyone still facing the issue after deleting the vendor directory and did composer install try to update your composer by composer selfupdate then do the same install process.

Upvotes: 0

Lafoune
Lafoune

Reputation: 486

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

Upvotes: 1

Alimin
Alimin

Reputation: 2747

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.

Upvotes: 3

Alihossein shahabi
Alihossein shahabi

Reputation: 4362

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.

Upvotes: 11

Related Questions