I'm working on a PHP web app which ALSO has some command line tools. I need the command line tools to detect the environment so that they connect with the correct DB credentials etc. The web app does this easily by checking
$_SERVER['SERVER_NAME'] but that doesn't work for a shell script.
I'd like to create my own
$_SERVER variable that the shell script can check. Ex:
$_SERVER['MYAPP_ENVIRONMENT']. How do I do this?
I found this solution, but I don't see the same files in
/etc/apache2/. I also found this, but they're using .htaccess and I'm not sure if I have
mod_env and also my app uses it's own .htaccess file, so it would have to be edited every time I deploy.
I'm on a Dreamhost VPS, which runs Ubuntu 12.04 LTS