I have an laravel app working fine on my local machine. I have just transferred it to my server (Shared hosting) and put everything on a public folder in public_html and everything else in one step above public_html. The problem is now it shows 500 internal error on every route. I have changed .htaccess code to given code on documentation, folder rights to storage and bootstrap are set to 777.
Nothing in error logs and also nothing in laravel log files. when I installed fresh laravel installation it worked on the server as well. Tried updated code with my project but still 500 internal error.
The error may be due to the configuration of .env file.As your question is not clear enough. so i wil explain 2 methods
With vendor and .env file (Not Recomended) - Unzip the main zip file and upload your public_html folder ( upload vendor folder as well)
Give 777 recursive permission to storage/ and bootstrap/ folder
Create database in phpmyadmin and import .sql file
Set Database in .env file
Now normally for all shared hostings you will have jailed SSH you can contact the hosting provider to get its details.
Once you get access , use command
php artisan cache:clear
php artisan config:clear
php artisan config:cache
The file itself can be found in bootstrap/cache/config.php.
Note that the location of the compiled config file has changed recently. Yours might also be in vendor/config.php or storage/framework/config.php. With a fresh install or if you run composer update the file should be in bootstrap/cache though.
Now Directly from GIT or other Sources without Vendor(Recommended)
Make sure you copy all of the project files including the hidden ones(.env).
if You are using GIT use GIT clone to clone the project.
Check you have all the necessary PHP extensions available in php.ini as in Laravel requirements. Also, watch your PHP version!
Install composer https://getcomposer.org/doc/00-intro.md
When copied, go to your destination folder and run composer install.
Run php artisan key:generate from the command line.
then Run
php artisan cache:clear
php artisan config:clear
php artisan config:cache
http://php.net/manual/en/install.windows.commandline.php
Make sure your webserver is serving pages from project/public folder.
Even after completing these steps if Laravel is still showing error, check your_project/storage/logs/laravel.log