PHP Environment variable not working

Posted October 30, 2015 3.9k views
PHPLinux Commands

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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.