PHP Environment variable not working

October 30, 2015 766 views
Linux Commands PHP

Hello, imm trying to se a new enviroment variable called "CIENV" but it doesn't working. I tried to do it through the terminal and get it from $ENV['CIENV'] but nothing.. When i vardump $_ENV its not even there. How the hell can i do it?

1 Answer

It's hard to know for sure without more details but if you are running your PHP script via your web server it will be running as www-data and would not have access to environment variables created under other user accounts.

Have another answer? Share your knowledge.