Today I tried uploading my first website,but i’m getting an error.On the local server it works fine but when I uploaded it to the live server,i’m getting an error that is saying “Whoops, looks like something went wrong”.To be more specific it’s showing twice on the same page.Check the image bellow.
Steps followed while uploading project to live server:
-
Zipped the file
-
Created a new folder at the root directory.
-
Unzipped the file in the new folder.
-
Moved all the files from public folder to /public_html/
-
Edited the locations on the index.php file.
Note: Other than index.php I haven’t altered any other file.
I followed a lesson on youtube and with these steps, his project worked but mine is throwing an error.
I have also noticed that after unzipping the folder in the cpanel the .env file is missing.Could this be the issue?
5
Answers
thanks to all of you who replied.I found the solution.It turns out the cause for the error was a simple spelling mistake in my .env file.
Follow the installation guide https://laravel.com/docs/5.6
config.php
filephp artisan key:generate
).env
exists or notMake the .env file is there .
Then don’t forget to generate the application key
There are some times that the .env file isn’t being read by the server. You may try to edit the .env file and supply the necessary credentials according to your server such as the following:
The lines with the asterisks are the ones you typically need to fill up. The APP_KEY can be set by using the
php artisan key:generate
command in your local workspace, then copy the value to your live server.If the .env can’t be read and it still shows an error, try to edit the
config/app.php
file and change'key' => env('APP_KEY'),
into'key' => yourgeneratedkey,
. Try to also change the values in yourconfig/database.php
file into the same one as your .env fileThis is caused by missing “.env” file, copy the content of “.env.example” file and create a new “.env” file in the same directory as your “example.env” file.
then run: php artisan key:generate