Laravel 工匠服务错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46853207/
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:50:50  来源:igfitidea点击:

Laravel artisan serve error

phplaravelartisan

提问by matynjr

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

当我运行 php artisan serve 命令来启动 laravel 时出现此错误是 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

PHP 警告:需要(/home/matynjr/events/vendor/autoload.php):无法打开流:第 18 行的 /home/matynjr/events/artisan 中没有这样的文件或目录

PHP 致命错误:require(): 在 /home/matynjr/events/artisan on line 中打开所需的 '/home/matynjr/events/vendor/autoload.php' (include_path='.:/usr/share/php') 失败18

回答by Александр Волошиновский

run in your project root folder cmd with composer updatecommand

使用composer update命令在您的项目根文件夹 cmd 中运行

回答by Osein

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.

您需要去您的项目室并安装依赖项。它说没有供应商文件夹。供应商文件夹是 Composer 的一部分。它在里面保存依赖文件。

Run composer installin the project root. It is a good idea to run composer updateafter that.

composer install在项目根目录中运行。composer update在那之后跑是个好主意。

回答by Wisnu Pramono E.S

For faster results you can use

为了更快的结果,您可以使用

composer update --verbose --prefer-dist

回答by Kayode Emmanuel Akinwumi

on your root folder run cmdby replacing root directory with cmdor open new terminal, navigate to your project root folder and follow the steps below
1 run composer install2 composer update3 restart your app 4 then run php artisan serve

在您的根文件夹上运行,cmd通过用 cmd 替换根目录或打开新终端,导航到您的项目根文件夹并按照以下步骤操作
1 运行composer install2 composer update3 重新启动您的应用程序 4 然后运行php artisan serve

回答by Henry LowCZ

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

如果composer install/composer update不适合您,请尝试:

composer install --ignore-platform-reqs

OR

或者

composer update --ignore-platform-reqs


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


在此之后,您应该能够运行“ php artisan serve”。

回答by QamarAbbas

run

 composer install 
在您项目的根目录中