0
votes

I am getting this error: PHP Warning: require(/home/rabin/blog/vendor/autoload.php): failed to open stream: No such file or directory in /home/rabin/blog/artisan on line 18 PHP Fatal error: require(): Failed opening required '/home/rabin/blog/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/rabin/blog/artisan on line 18

The commands php, composer and laravel is working fine but php artisan is always giving me this erros. Please help me out on this(screenshot included below) Screenshot

2
Does the file actually exist though?apokryfos
I am not getting you.... You mean the project file @apokryfos if yes yeah I blog is the project folder I have navigated...Rabin Dhamala
I mean the file /home/rabin/blog/vendor/autoload.php. does it exist?apokryfos
The vendor folder doesn't exist inside blog but the artisan file exists...Rabin Dhamala
Have you done tried composer install? I'm thinking that you have this skipped that's why it's looking for a file that doesn't exist.Jerico Pulvera

2 Answers

1
votes

You could run the following command in your project directory to generate your vendors folder:

composer update
1
votes

First of all make sure you have a composer.json in your project root directory. If it exists then make sure you have composer installed Then run the following command

composer update

It will create a vendor folder and all dependency inside the vendor folder and create the autoload.php file.

If you already have the vendor folder with all the dependencies inside your project then you need to regenerate the autoload.php file to do it run the following command

composer dump-autoload

NOTE: make sure packagist.org is NOT blocked from your network. If it is blocked then use a proxy.