Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploaded Laravel project on 000WebHost that's not working

I recently uploaded my laravel blog project on 000WebHost, after that I redirected to URL http://laravelcreativeblog.000webhostapp.com/, but I saw this error Whoops, looks like something went wrong., this error is displayed two times one after the other. So I googled that and finally I reached to the a solution that there is an error in APP_KEY which I found here /public_html/storage/logs/laravel.log and error at last is:

[2018-10-18 15:44:47] production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at /storage/ssd1/217/7530217/public_html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42) [stacktrace]

So I generated Application Key from CMD by php artisan key:generate and put in the .ENV File but again getting that error. This is all I done, so any suggestions???

like image 745
Usman Developer Avatar asked Oct 18 '18 11:10

Usman Developer


2 Answers

I fixed the error the error was that 000WebHost does not support .ENV file variables, so we must add all .env detials into config/app.php file and database details into config/database.php. Read the last FAQ here, https://www.000webhost.com/forum/t/deploy-laravel-project-into-000webhost-site/127323 for more details(only for 000WebHost).

like image 182
Usman Developer Avatar answered Sep 19 '22 13:09

Usman Developer


When you receive "No application encryption key" error:

  1. be sure that you have .env file in root directory
  2. run php artisan key:generate
like image 31
Aleksandrs Avatar answered Sep 19 '22 13:09

Aleksandrs