0

I had uploaded laravel 5.3 project on shared hosting. But I am getting internal server error on every route. I had given 777 permission to all files and folder, but still getting that error. I had uploaded the laravel project in sub folder inside public_html folder.

My .htaccess file(public_html/xyz/public/.htaccess) : Options -MultiViews

RewriteEngine On


# 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}]

My index.php file(public_html/xyz/public/index.php) :

    <?php

    /**
    * Laravel - A PHP Framework For Web Artisans
    *
    * @package  Laravel
    * @author   Taylor Otwell <taylor@laravel.com>
    */

    require __DIR__.'/../bootstrap/autoload.php';


    $app = require_once __DIR__.'/../bootstrap/app.php';

    // set the public path to this directory
    $app->bind('path.public', function() {
    return __DIR__;
    });

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
Nitish Mahna
  • 71
  • 10
  • If you have access to any error logs from the web server, check those. If not, turn display errors on (like in your htaccess while debugging. Here's how: https://stackoverflow.com/questions/6127980/enabling-error-display-in-php-via-htaccess-only). An internal server error could be anything so we need to find the _actual_ error message. – Magnus Eriksson Jul 02 '17 at 09:02
  • Did you install with composer? Might have to run `composer install`. Check the log file in storage/logs and eventually the hoster also provides apache logs. If you don't have command line access, make sure you also uploaded the `vendor` folder – Michel Feldheim Jul 02 '17 at 09:04

0 Answers0