3
votes

I get this error when I run the php artisan serve command to launch laravel am a beginner in laravel

PHP Warning: require(/home/matynjr/events/vendor/autoload.php): failed to open stream: No such file or directory in /home/matynjr/events/artisan on line 18

PHP Fatal error: require(): Failed opening required '/home/matynjr/events/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/matynjr/events/artisan on line 18

8
Have you run composer install?aynber
@aynber My guess is that this is the problem, maybe add that as an answer?ljubadr
@ljubadr That's such a common issue that I think it would probably be a duplicate.aynber

8 Answers

10
votes

run in your project root folder cmd with composer update command

6
votes

You need to go to your project room and install dependencies. It says that there is no vendor folder. Vendor folder is a part of composer. It holds dependency files inside.

Run composer install in the project root. It is a good idea to run composer update after that.

2
votes

For faster results you can use

composer update --verbose --prefer-dist
1
votes

on your root folder run cmd by replacing root directory with cmd or open new terminal, navigate to your project root folder and follow the steps below
1 run composer install 2 composer update 3 restart your app 4 then run php artisan serve

1
votes

If composer install / composer update isn't working for you, try:

composer install --ignore-platform-reqs

OR

composer update --ignore-platform-reqs


After this you should be able to run "php artisan serve".

1
votes

run

 composer install 
0
votes

In my case, there were some issues in composer. I resolved it by running this command in cmd in project's root folder:

composer update

-1
votes

On my case it was because the vendor file was missing. type this to fix it:

composer install --ignore-platform-reqs

but, still if i make a new project i have to fix the vendor file again.