1

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?

6
  • 4
    Open the .env file and enable debug mode Commented Jun 19, 2018 at 5:24
  • Provide the write permission on storage folder and than run php artisan config:cache and refresh the page Commented Jun 19, 2018 at 5:43
  • @DsRaj thank you for the reply but by default debug mode is set to true. Commented Jun 19, 2018 at 6:01
  • What steps have you specifically done in deploying your project? Add them to your question Commented Jun 19, 2018 at 6:04
  • Have you change the path for 'vendor/autoload.php' in index file because you move your files Commented Jun 19, 2018 at 6:19

5 Answers 5

0

Make the .env file is there .

Then don't forget to generate the application key

php artisan key:generate 
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

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

Comments

0

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

Comments

0

I found the solution.It turns out the cause for the error was a simple spelling mistake in my .env file.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.