Bob Barthel
Bob Barthel

Reputation: 21

500 Internal Error: Failed to load resource Laravel 5.0

When I try to deploy my Laravel project to the server it doesn't work anymore (on localhost everything works) and the only error message is:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

And I found out (through commenting out code and trial and error) that the error is probably somewhere in the index.php around these lines:

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

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

$response->send();

$kernel->terminate($request, $response);

What could the problem be? And how do I fix it?

Upvotes: 2

Views: 13104

Answers (2)

Manuel Perez
Manuel Perez

Reputation: 1

Finally Overcame the problem

It was not the .htaccess file that was the problem nor the index.php. The problem was on accessing the files and requiring permissions. For solving the problem i ran the following commands through terminal.

sudo chmod -R 755 /var/www/html/sirehucalidad

and then type below to allow laravel to write file to storage folder

chmod -R o+w /var/www/html/sirehucalidad/storage

This two commands solved the problem.

Referencia: Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04

Upvotes: 0

bunkinet
bunkinet

Reputation: 103

I have been working on this error for a while recently and resolved successfully. But my laravel version is 5.8. First of all you better find out the exact error passed by the server log causing 500 internal error using browser's debug tools.

  1. If you are on chrome, press F12 or r-click on page and select inspect.
  2. Now go to 'Network' Tab. You will locate in the list an entry with status '500' for your error.
  3. Click on that item, and it will show the variable or parameter not defined in details.
  4. This variable has to be defined locally on top and outside your current function. Ex: private $request;

This should clear the 500 error and may start showing any further errors. Trouble shoot them also by observing the network tab.

Upvotes: 3

Related Questions