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
But it doesn't work with El Capitan. You should disable System Integrity Protection.
original