Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lumen failed to open /../vendor/autoload.php

Tags:

php

lumen

I started using Lumen upon its release in April.

From version 5.0, I already faced this same problem and found a solution (see here).

There are some days I proceeded to create a new project in Lumen (5.1). However, by applying the method with the .htaccess above, the problem doesn't solve it this time.

Here is the full error :

Warning: require_once(path_of_the_project/../vendor/autoload.php): failed to open stream: No such file or directory in path_of_the_project\bootstrap\app.php on line 3

Fatal error: require_once(): Failed opening required 'path_of_the_project\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in path_of_the_project\bootstrap\app.php on line 3

How to fix it?

like image 910
w3spi Avatar asked Sep 15 '15 11:09

w3spi


2 Answers

In your bootstrap/app.php file, change:

require_once __DIR__.'/../vendor/autoload.php';

Into:

require_once dirname(__DIR__).'/vendor/autoload.php'; 

And make sure you have ran composer update -vvv SUCCESSFULLY.

like image 173
krisanalfa Avatar answered Nov 04 '22 01:11

krisanalfa


I got the same error and resolved it by running the below command from project root folder.

composer update -vvv
like image 43
Vinoth Avatar answered Nov 03 '22 23:11

Vinoth