Welcome Guest, Not a member yet? Register   Sign In
Accessing OS env variables?
#1
Question 

I'm figuring out how to deploy CI3 project with Kubernetes and ran into a problem with environment variables.

Namely, in my Kubernetes YAML manifests I declare several environment variables depending on the application environment (dev/staging/production).
I can see those variables when I run env in container CLI but for some reason, I can't access out those variables with PHP.

I tried several things:
1. I configured clear_env = no in my PHP-FPM pool config (www.conf) - Didn't work
2. I configured variables_order = "EGPCS" in php.ini - Didn't work

Any suggestions on how do I access OS environment variables?


Thanks in advance!
Reply
#2

> I can't access out those variables with PHP.

What did you do? and what did you get?
Reply
#3

(09-23-2021, 05:09 PM)kenjis Wrote: > I can't access out those variables with PHP.

What did you do? and what did you get?

Basically, tried accessing OS env vars via getenv() just to print them out and confirm that they're accessible.
Any suggestions?
Reply
#4

Did you try using this one?

PHP Code:
echo $_ENV["VAIABLENAME"]; 

Try it and see what you get back.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

call getenv() function
Enlightenment  Is  Freedom
Reply




Theme © iAndrew 2016 - Forum software by © MyBB