Laravel 5无法打开所需的bootstrap /../ vendor / autoload.php

本文翻译自:Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

I have recently installed Laravel 5 via composer. 我最近通过作曲家安装了Laravel 5。 I tried creating a new controller using artisan and I get the following error: 我尝试使用工匠创建一个新的控制器,我收到以下错误:

bootstrap/../vendor/autoload.php. 自举/../供应商/ autoload.php。 Failed to open stream: No such file or directory. 无法打开流:没有这样的文件或目录。 The "vendor" folder does not exist. “vendor”文件夹不存在。

Am I missing something? 我错过了什么吗?


#1楼

参考:https://stackoom.com/question/1vRzN/Laravel-无法打开所需的bootstrap-vendor-autoload-php


#2楼

在根项目文件夹(或php composer.phar install )中运行composer install


#3楼

Did you create a new project or did you clone an existing project? 您是否创建了新项目或者是否克隆了现有项目?

If you cloned an existing project it's very important to run 如果您克隆了现有项目,那么运行非常重要

composer install

That way all the dependencies that are missing will be installed. 这样就可以安装所有缺少的依赖项。

But if you create a new project you should run this command to make a new project using composer 但是如果你创建一个新项目,你应该运行这个命令来使用composer创建一个新项目

composer create-project laravel/laravel name-of-your-project

#4楼

Which OS you are using ? 你正在使用哪种操作系统? For Windows : Go to Command Prompt 对于Windows:转到Command Prompt

set path to www/{ur project} 设置www/{ur project}路径

For me : www/laravel5 对我来说: www/laravel5

Then type this command : composer install 然后输入以下命令: composer install

It will automatically install all dependency in vendor/ 它将自动安装vendor/所有依赖vendor/


#5楼

Turns out I didn't enable openssl in my php.ini so when I created my new project with composer it was installed from source. 事实证明我没有在我的php.ini中启用openssl所以当我用composer创建我的新项目时,它是从源代码安装的。 I changed that and ran 我改变了然后跑了

composer update

now the vendor folder was created. 现在已创建供应商文件夹。


#6楼

I also had that error. 我也有这个错误。 But none of the above solved the issue. 但上述都没有解决问题。 So i uninstalled and again installed the composer. 所以我卸载并再次安装了作曲家。 Then i did composer update . 然后我做了composer update and the problem was fixed. 问题得到解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值