3
votes

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

2
Read the docs at laravel.com. How did you install? Seems like you're missing the vendor files, normally a composer install installs these. In the future, post formatted text, not images.Devon
If you are using xamp, why do you need to run this command? Xamp is already serving the directory if it in is htdocs.Taylor Foster
yeah i had installed composer through composer install @DevonKritarth Billorey
yes but when I try to access localhost/folder/public/index.php same error occur but this time on the browser window @TaylorFosterKritarth Billorey
You need to point Xamp to laravels public folder. You'll find what you need hereTaylor Foster

2 Answers

4
votes

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

http://localhost/project/public

NB:Just ensure xampp is running

1
votes

please go through the documentation first

https://laravel.com/docs/5.4#installation

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

localhost/your_project/public

hope it helps !!!