I set an Environment Variable on Windows (System Propeties->Advanced->Environment Variables) and tried to access it from a php code, like this:
getenv('ENV');
My php runs on Xampp's Apache server and it returned false
.
I read that for security reasons I have to use PassEnv
Directive inorder for Apache to recognize Environment Variables. I tried to use it within .htaccess
and .conf
files but didn't succeed.
Would like to understand what I am missing, and what should I do to access the environment variable.
- PHP 5.6
- Apache 2.0