Laravel 5 Failed opening required bootstrap/../ven

2019-01-03 19:39发布

I have recently installed Laravel 5 via composer. I tried creating a new controller using artisan and I get the following error:

bootstrap/../vendor/autoload.php. Failed to open stream: No such file or directory. The "vendor" folder does not exist.

Am I missing something?

标签: php laravel-5
25条回答
倾城 Initia
2楼-- · 2019-01-03 19:52

I encountered the same problem. It occurred because composer was not able to install the dependencies specified in composer.json file. try running

composer install 

If this does not solve the problem, make sure the following php modules are installed php-mbstring php-dom

To install this extensions run the following in terminal

sudo apt-get install php-mbstring php-dom

once the installation is complete

try running the command in your project root folder

composer install 
查看更多
Deceive 欺骗
3楼-- · 2019-01-03 19:52

Before you carry out the following instructions you need to make sure you have composer installed globally on your machine; Open you Mac terminal and run the following command:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

once composer is installed globally run the following command after you are in the directory of the project:

composer install

once completed in it update and install all the required packages.

查看更多
看我几分像从前
4楼-- · 2019-01-03 19:54

When the new project created the laravel require to load vendors to autoload the libraries , We use composer update to

composer update

Composer is a dependency manager allows you to delegate responsibility for managing your dependencies to a third party.

查看更多
等我变得足够好
5楼-- · 2019-01-03 19:54

This solution worked for me.The reason is not have vendor folder in your application.follow these steps.

1)if your project have composer.json file..delete it

2)then run

composer require phpspec/phpspec

that command add vendor folder to your project

查看更多
霸刀☆藐视天下
6楼-- · 2019-01-03 19:55

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. I changed that and ran

composer update

now the vendor folder was created.

查看更多
干净又极端
7楼-- · 2019-01-03 19:58

You need to regenerate autoload.php file. you can use dump-autoload to do that without having to go through an install or update.

use

composer dump-autoload

to generate autoload.php file again in /vendor directory.

查看更多
登录 后发表回答