Reputation: 21
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
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
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.
This should clear the 500 error and may start showing any further errors. Trouble shoot them also by observing the network tab.
Upvotes: 3