I assume that MAMP environment variables can be set in ~/.bash_profile, but it seems that setting them there does not always take effect right away. For instance, I just set
If you still can't get your environment variables:
you may need to edit your real httpd.conf in
~/Library/Application Support/appsolute/MAMP PRO/
instead of
/Applications/MAMP/conf/apache/
Also you may need to use getenv() instead of $_ENV