Leravel 5 deployment getting :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
My file structure:
|
|-pub -> from laravel folder public
|-my_apps
|- my_first_app -> all other files from laravel project
|- app
|- bootstrap
|- config
|- database
|- resources
|- storage
|- ...
I have set storage folder permission to be:
user::rwx
group::rwx
other::rwx
This is my .htaccess file in directory /pub
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase / <-------- I added this line
# 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]
</IfModule>
I also change path in \pub\index.php
<?php
//updated path
require __DIR__.'/../my_apps/my_first_app/bootstrap/autoload.php';
//updated path
$app = require_once __DIR__.'/../my_apps/my_first_app/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);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire