skip to Main Content

I have a Laravel app, been using a specific set of database settings for a very long time, now I uploaded the whole application to CPanel and trying to change both the .env and .env.example files but still, when I look at the error logs uses the old database details, am stuck. Thanks in advance.

2

Answers


  1. Chosen as BEST ANSWER

    After cracking and scratching my head several times, I actually used these laravel CLI commands

    php artisan config:clear
    
    php artisan cache:clear
    

    Now everything is working okay. Of course I took it offline first and used htdocs until it worked okay then uploaded the latest files.


  2. I’m not sure if you are using the latest laravel framework 5.4 but you can try the following:

    Clearing the config cache with this artisan command

    php artisan config:clear

    Checking the environment

    php artisan env

    With this command you can make sure that you are running under the correct environment. If you are using specific .env file such as “.env.local” or “.env.dev” etc.

    Make sure there’s nothing wrong with your dbms installation and try to connect to another blank db.

    Hope this helps you!

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