CodeIgniter Forums
No DBDebug - what's going on with .env variables??? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: No DBDebug - what's going on with .env variables??? (/showthread.php?tid=78377)



No DBDebug - what's going on with .env variables??? - tgix - 01-11-2021

I have started to get serious problems with settings from .env not picked up by CI4. 
Just now I stopped getting exceptions thrown on Database errors due to the setting in app/config/Database.php:
PHP Code:
public $default = [
    // ...
    'DBDebug'  => (ENVIRONMENT !== 'production'),
    // ...
]; 
In my .env I have set CI_ENVIRONMENT = development but still if I do a die(ENVIRONMENT) in app/config/Database.php::__construct I get "production" and thus DBDebug = false and thus I have unnoticed bugs in my code.

This happens on PHP 7.3.26 now both in CLI and in Apache. Running on macOS 10.15.7 installed via homebrew.