skip to Main Content

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.
enter image description here
Steps followed while uploading project to live server:

  1. Zipped the file

  2. Created a new folder at the root directory.

  3. Unzipped the file in the new folder.

  4. Moved all the files from public folder to /public_html/

  5. 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


  1. Chosen as BEST ANSWER

    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.


  2. Follow the installation guide https://laravel.com/docs/5.6

    • Check the server requirements(check if all the required extensions are installed).
    • Check if all the files are there.
    • Check Configurations
      • check config.php file
      • check directory permissions.
      • generate application key (php artisan key:generate)
      • Check if .env exists or not
    Login or Signup to reply.
  3. Make the .env file is there .

    Then don’t forget to generate the application key

    php artisan key:generate 
    
    Login or Signup to reply.
  4. 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:

        APP_URL= *
        APP_KEY= *
        DB_CONNECTION=mysql
        DB_HOST= *
        DB_PORT=3306
        DB_DATABASE= *
        DB_USERNAME= *
        DB_PASSWORD= *
    

    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 your config/database.php file into the same one as your .env file

    Login or Signup to reply.
  5. This 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search