Laravel 5 on shared hosting getting internal server error

9.9k views Asked by At

I am trying to get my Laravel 5 project running on my shared hosting through FTP.

I have uploaded all my project files from my local XAMP-folder to the server root directory and put the files in the 'public' folder in the public_html folder.

When I go to mydomain.com I get redirected to mydomain.com/auth/login as I set in my routes.php so that seem to be working although I'm getting 500 internal server error on all paths.

2

There are 2 answers

3
Oliver Adria On BEST ANSWER

Sometimes this is because the storage folder is not writeable by the server. One possible way is go via ssh into the app (i.e. /path/to/mywebsite) and then do

chmod -R 777 storage/

Because logs, caches, need to be written there. Or you can also do that with the FTP app (just make everything executable, readable, writeable).

UPDATE:

Another solution (that I use every now and then - and apparently also worked here :-) ) is to add

RewriteBase /

as a line right after

RewriteEngine On

in the .htaccess file.

0
Julius Tan On

Laravel requires storage to be readable, writable, and executable by all, so you need to run

chmod -R 777 storage/

That usually solves the problem, but if Internal Server 500 still persists, run

composer dump-autoload

then

php artisan optimize