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
You can set your environment variables in Apache configuration...
/Applications/MAMP/conf/apache/httpd.conf SetEnv MY_VAR theValue SetEnv ANOTHER thisIsTheValue