laravel failed to open stream fatal error when running php artisan serve command

All we need is an easy explanation of the problem, so here it is.

i had recently installed laravel in windows through composer made a new project named project in my xamp’s htdocs folder then run “php artisan serve” comand in cmd but it is giving me error “failed to open stream” here is screenshot here I ran “php artisan serve” comand error is shown in above image I also tried to search my problem on stack overflow but couldn’t find any solution that can suit my problem

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Most files are missing because you have not successfully installed Laravel.

Go to C:\xampp\htdocs\project> and type composer update --no-scripts or composer install

Since you are using xampp, once all the necessary files and packages are downloaded to your project you should be able to access your site through localhost without running php artisan serve by visiting


NB:Just ensure xampp is running

Method 2

please go through the documentation first

you did not installed laravel projects correctly. you did not have vendor files. First you have to run :

composer install

dont need php artisan serve in xampp … just go to


hope it helps !!!

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply