Christian
Christian

Reputation: 888

How to fix laravel v6.18.38 after mistake in cache driver selection?

After a mistake in the laravel .env (cache_driver was set incorrectly to "data") the complete systems is broken. I have changed the driver name back to a valid value ("file") but still literally any "php artisan ..." command replys with "InvalidArgumentException : Cache store [data] is not defined.". So it seems the change in the .env is simply ignored. Also composer dump-autoload fails with the same error.

Upvotes: 0

Views: 191

Answers (1)

lagbox
lagbox

Reputation: 50511

If you run into an issue where you have a cached configuration and you have errors that stop artisan from running you can delete this cached configuration file manually, the file is:

bootstrap/cache/config.php

As a side note, if you are developing locally, there isn't much need to cache your configuration or routes. Doing so will often get in your way as you will update things and not see the changes until you cache the configuration/routes again or clear the cached configuration/routes. Obviously if you are deploying this to your server caching these things is a benefit.

Upvotes: 2

Related Questions