Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

brentmtc's avatar

Local Laravel 5 site outputs warning error

I get the following error trying Laravel 5 app. Any ideas? Thanks! Warning: require(/home/vagrant/Code/learning-laravel-5/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/Code/learning-laravel-5/bootstrap/autoload.php on line 17

0 likes
14 replies
pmall's avatar

You have to install required packages by running composer install command.

3 likes
brentmtc's avatar

When I run composer install within ~/.composer I get. 'Loading composer repositories with package information' 'Installing dependencies (including require-dev) from lock file' 'Nothing to install or update' 'Generating autoload files'

Then I get the same errror.

pmall's avatar

You have to run it from the root of your project. Where the composer.json is. (I guess it is /home/vagrant/Code/learning-laravel-5)

It will download every packages required for laravel and install them in the vendor folder. Then it generates an autoload.php file that is used by laravel in order to autoload all the classes.

brentmtc's avatar

Running composer install in the root of the project (on vagrant box) worked. Thank you! Follow do I need to do this for every subsequent new L5 app? Thanks!

pmall's avatar

Yes you have to do this for every laravel app.

bashy's avatar

By default the /vendor/ folder is not stored in git and is not included when you pull it in with composer/zip etc. This is your personal app's package directory.

ElmosGotAGun's avatar

running composer install inside my root folder, I get a problem with laravel/framework requires ext-mbstring. Any idea how to fix that? thanks

bashy's avatar

You will need to install it into PHP. It's an extension which is required.

I think it's in the php5-cli package.

1 like
michaeldyrynda's avatar

Installing mbstring will depend on the operating system - Ubuntu/Debian/CentOS should have a php5-mbstring package you can install. OS X you'll have to recompile PHP. Windows ???

1 like
deromanenko's avatar

On Windows you just should uncomment "extension=php_mbstring.dll" string in php.ini - it ships by default all needed modules.

Also, you must uncomment ' extension_dir = "ext" ' in php.ini, to make php found it's own modules :/

mm256's avatar

I still get the error after running composer install on my vagrant project directory

Warning: require(/home/vagrant/Code/Laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/Code/Laravel/bootstrap/autoload.php on line 17 Call Stack

Time Memory Function Location

1 0.0008 355472 {main}( ) .../index.php:0 2 0.0025 355720 require( '/home/vagrant/Code/Laravel/bootstrap/autoload.php' ) .../index.php:21

Fatal error: require(): Failed opening required '/home/vagrant/Code/Laravel/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:') in /home/vagrant/Code/Laravel/bootstrap/autoload.php on line 17 Call Stack

Time Memory Function Location

1 0.0013 355648 {main}( ) .../index.php:0 2 0.0017 355896 require( '/home/vagrant/Code/Laravel/bootstrap/autoload.php' ) .../index.php:21

mm256's avatar

I just did a vagrant destroy and up and everything worked

uniquecoder's avatar

Just Open Command Terminal and go to your project root directory and type composer install if already installed then type Composer Update

Please or to participate in this conversation.