Welcome Guest, Not a member yet? Register   Sign In
Handling environments using .env

I started with an .htaccess that was pretty standard:

RewriteEngine On
RewriteBase /

RewriteRule ^(system|application|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

I know CI4 comes with its own .htaccess, but they can sometimes be finicky, so I thought I'd test out using a different one.

Per documentation here: https://bcit-ci.github.io/CodeIgniter4/g...s.html#env

Seems like I should be able to add this to my .env:

CI_ENVIRONMENT = development

and then CodeIgniter should start displaying errors instead of "whoops". This does not work for me. The only way I can change the environment to development is with this line in .htaccess:

SetEnv CI_ENVIRONMENT development

So, then I noticed that the env file in root directory is not prefixed with a dot. I added the dot, but still no love.

After that I swapped out my .htaccess file for the one provided by CI4, but still not love.

On this page https://bcit-ci.github.io/CodeIgniter4/g...ation.html it seems to indicate that nothing else should need to be done:

Quote:When your application runs, this file will be automatically loaded and the variables will be put into the environment. This will work in any environment.

If it matters, this is a Ubuntu 16.04 / PHP 7.2 server.

What does one do to get the .env file to work? Please point to documentation if available.

Messages In This Thread
Handling environments using .env - by skunkbad - 09-29-2018, 06:21 AM
RE: Handling environments using .env - by sv3tli0 - 09-29-2018, 06:55 AM
RE: Handling environments using .env - by sv3tli0 - 09-29-2018, 08:47 AM
RE: Handling environments using .env - by sv3tli0 - 09-29-2018, 11:41 PM

Theme © iAndrew 2016 - Forum software by © MyBB