laravel 运行php artisan serve命令时laravel无法打开流致命错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45825053/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 16:32:23  来源:igfitidea点击:

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

phplaravelcomposer-php

提问by Kritarth Billorey

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" comanderror 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

我最近通过 Composer 在 windows 中安装了 laravel,在我的 xamp 的 htdocs 文件夹中创建了一个名为 project 的新项目,然后在 cmd 中运行“php artisan serve”命令,但它给了我错误“无法打开流”这里是截图,我在这里运行“php工匠服务”命令错误显示在上图中我也尝试在堆栈溢出时搜索我的问题,但找不到任何适合我的问题的解决方案

回答by Emeka Mbah

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

大多数文件丢失是因为您没有成功安装 Laravel。

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

转到C:\xampp\htdocs\project>并键入composer update --no-scriptscomposer 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 serveby visiting

由于您使用的是 xampp,一旦所有必要的文件和包都下载到您的项目中,您应该能够通过 localhost 访问您的站点,而无需php artisan serve通过访问来运行

http://localhost/project/public

NB:Just ensure xampp is running

注意:只需确保 xampp 正在运行

回答by Mirthful Nahid

please go through the documentation first

请先阅读文档

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

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 :

你没有正确安装 Laravel 项目。您没有供应商文件。首先你必须运行:

composer install

作曲家安装

dont need php artisan serve in xampp ... just go to

不需要 php artisan 在 xampp 中服务......只需去

localhost/your_project/public

本地主机/你的项目/公共

hope it helps !!!

希望能帮助到你 !!!