lulliezy
lulliezy

Reputation: 2043

Laravel app won't update database connection settings

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.

Upvotes: 0

Views: 4121

Answers (2)

lulliezy
lulliezy

Reputation: 2043

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.

Upvotes: 1

Sim
Sim

Reputation: 46

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!

Upvotes: 0

Related Questions