just moved over my laravel site to my live server and straight away faced with this error.
The complete error is:
Warning: require(/var/sites/b/beta.buildsanctuary.com/public_html/local/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/sites/b/beta.buildsanctuary.com/public_html/local/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/var/sites/b/beta.buildsanctuary.com/public_html/local/bootstrap/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/sites/b/beta.buildsanctuary.com/public_html/local/bootstrap/autoload.php on line 17
The line 17 is:
require DIR.'/../vendor/autoload.php';
Folder structure is:
beta.buildsanctuary.com
-- public_html
-- subdomains
-- beta
-- local
-- bootstrap
-- vendor
Any help where this is going wrong? And how to fix? Pulling my hair out trying all sorts of paths.
Thanks, Craig.
As you can see from the error, PHP is looking for
public_html/local/bootstrap/../vendor/autoload.php`
which is
public_html/local/vendor/autoload.php
That folder does not exist. I think the folder structure you posted is wrong.
Anyway, try this:
require('../vendor/autoload.php');
I strongly believe that a corrupted cache was the cause, I cannot be 100% sure but it seem that it is likely the culprit.
So, if anyone comes across a similar problem, I would suggest the following steps:
composer clearcache
(or clear-cache)composer install
I hope this can help somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With