laravel 如何解决php artisan key生成错误?

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

How to solve php artisan key generate error?

laravellaravel-5composer-phplaravel-5.5

提问by D. Sean

I created a new Laravel 5.5 project with this command:

我用这个命令创建了一个新的 Laravel 5.5 项目:

laravel new crud-angular

Laravel 新的 crud-angular

After then, run this command inside the project folder:

之后,在项目文件夹中运行此命令:

php artisan key:generate

php工匠密钥:生成

At that moment, I got such error:

在那一刻,我得到了这样的错误:

Warning: require(F:\Study\Laravel\crud-angular/vendor/autoload.php): failed to open stream: No such file or directory in F:\Study\Laravel\crud-angular\artisan on line 18

Fatal error: require(): Failed opening required 'F:\Study\Laravel\crud-angular/vendor/autoload.php' (include_path='.;C:\php\pear') in F:\Study\Laravel\crud-angular\artisan on line 18

警告:require(F:\Study\Laravel\crud-angular/vendor/autoload.php): 无法打开流:第 18 行的 F:\Study\Laravel\crud-angular\artisan 中没有这样的文件或目录

致命错误:require(): Failed opening required 'F:\Study\Laravel\crud-angular/vendor/autoload.php' (include_path='.;C:\php\pear') in F:\Study\Laravel\第 18 行的 crud-angular\artisan

I used wampserver 3.0.6 for this project. Hope to help me. Thanks

我在这个项目中使用了 wampserver 3.0.6。希望能帮到我。谢谢

回答by Marcin Nabia?ek

Make sure you have run:

确保你已经运行:

composer install

Now it seems packages are not installed. If they are, try running:

现在似乎没有安装软件包。如果是,请尝试运行:

composer dump-autoload

回答by Sivaraju Mani

Try to to give permission for that vendor folder

尝试授予该供应商文件夹的权限

sudo chmod -R 777 vendor

update your composer also

也更新你的作曲家

composer update

this will fix your issue

这将解决您的问题

回答by user3719458

Most likely you forgot to Install composer just run composer install

很可能你忘了安装 composer 就运行 composer install