Deploying Laravel 5 with an internal server error

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

    # 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 the 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);

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

+4
4

Laravel 5.1 PHP 5.5.9, packagist.

Laravel 5.0 PHP, packagist, - , PHP 5.5, .

5.5.0 ( ), , . Laravel PHP. PHP - .

+1

" " . , , .

, , apache /var/log/apache /var/log/httpd, Laravel . , , php php.ini.

+1

/var/log/apache 2 /var/log/httpd , . , , PHP 5.5.0

, laravel

, , , laravel 5.1 PHP 5.5.0, . - laravel 5.0, , , , laravel 5.0.

+1

, . Windows, . Linux, , .

laravels php_errors.log , .

0
source

Source: https://habr.com/ru/post/1617841/


All Articles