I'm working on Laravel 5.2 framework and run first time project
When i run root link display error:
Warning: require(/home/ubuntu/workspace/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/ubuntu/workspace/index.php on line 22 Call Stack: 0.0028 236248 1. {main}() /home/ubuntu/workspace/index.php:0 Fatal error: require(): Failed opening required '/home/ubuntu/workspace/../bootstrap/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/ubuntu/workspace/index.php on line 22 Call Stack: 0.0028 236248 1. {main}() /home/ubuntu/workspace/index.php:0
Before i call composer install
Its my application/.htpaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
routes.php
Route::get('/', function () {
return view('welcome');
});
application/index.php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
EDIT:
I replaced in index.php to
require __DIR__.'/../vendor/autoload.php';
But display error:
Warning: require(/home/ubuntu/workspace/../vendor/autoload.php): failed to open stream: No such file or directory in /home/ubuntu/workspace/index.php on line 22 Call Stack: 0.0004 233376 1. {main}() /home/ubuntu/workspace/index.php:0 Fatal error: require(): Failed opening required '/home/ubuntu/workspace/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/ubuntu/workspace/index.php on line 22 Call Stack: 0.0004 233376 1. {main}() /home/ubuntu/workspace/index.php:0
I have folder vendor in root directory. How me solve this issue? Thank you.