You'll probably have a file now generated in bootstrap/cache/config.php which is being referenced for your settings. But this will be broken as you're likely referencing environment variables directly from your app. I'm not sure how the cache works but it seems as if unless you've declared the variables you need in the Laravel PHP config files (which themselves can happily load directly from the .env file) you will run into this problem. So the quick fix would be to remove the config.php (or rename to .backup.php temporarily to test) and see if this fixes things. Then rework the way you are referencing settings in the app, and try caching it again afterwards - you most certainly don't want to encounter this problem on a production environment! Especially when doing this seems to knock out the use of artisan.
Aug 14, 2015
3
Level 1
all Artisan commands return error after cache clear
Hi,
On Laravel 5.1 I run php artisan config:clear I got the message saying that the operation went successfully but then all other artisan commands start returning:
PHP Fatal error: Cannot redeclare class Illuminate\Contracts\Config\Repository in /var/www/app/config/vendor/illuminate/contracts/Config/Repository.php on line 5
I haven't changed anything else, does anyone know why and how to fix this ?
Please or to participate in this conversation.