I'm trying to use a custom environment variable for environment detection in my PHP application. I've set the variable system-wide in /etc/environment, rebooted, and checked that it is visible through the terminal using printenv.
I've also checked that it is visible when running PHP at the command line:
php -r 'echo getenv("LOCAL_DEVELOPMENT");'
//returns 'true' as expected
But when I try from a web page script, the variable is not found:
var_dump(getenv("LOCAL_DEVELOPMENT"));
//returns 'boolean false' (not expected)
I'm using Ubuntu 12.04 LTS with PHP 5.4 and Apache 2.2.
Why is the variable not visible from a web script, and how do I fix this?