index.php ENVIRONMENT not able to be set from environment variable #1692
T012m3n7oR
started this conversation in
Ideas / Feature Requests
Replies: 1 comment
-
I like the idea. Will add it to my installation. Would you see issues here to include this @magicbug? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I see that reading from the CI_ENV variable was explicitly removed from the
index.php
file. Was this due to not being able to get it to work?I spent some time this morning trying to get this working as I run Cloudlog in a container, so being able to just set a variable, then change the variable if I need a different environment is significantly easier than trying to get on my host to edit the
index.php
file. I run portainer as access to the backend of all my docker containers.This is the line in
index.php
that is commented out: Line 56I commented out Line 57 in my file, and uncommented 56.
I had a ton of issues where the environment variable wasn't being considered set originally. I even tried to output the entire
$_Server
variable, and it was just blank. If I called a baregetenv()
I did see variables that were populated.For any other users that prefer environment variables, this is the line that I finally got to work in my environment:
define('ENVIRONMENT', getenv("CI_ENV") !== false ? getenv("CI_ENV") : 'development');
Beta Was this translation helpful? Give feedback.
All reactions