Deploying Laravel 5:
Internal server error
The server detected an internal error or an incorrect configuration and could not fulfill 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 set the permission for the storage folder:
User :: RWX
band :: RWX
other :: RWX
This is my .htaccess file in the directory /pub
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase / <-------- I added this line
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I also change the path in \pub\index.php
<?php
require __DIR__.'/../my_apps/my_first_app/bootstrap/autoload.php';
$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);
PHP on my local machine is PHP 5.6, this is PHP 5.5. I tried to add
AddHandler application/x-httpd-php55 .php
in .htaccess after RewriteEngine Online.
Refresh
PHP 5.5.0, Laravel 5.1 5.0, . https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e#.50q2s8wer . , laravel