I have installed MAMP on OS X Snow Leopard (10.6.8) and I want to change the default path for PHP.

I tried both of the answers on this question, and on this question, and in this thread but when I'm trying which php in Terminal I still get /usr/bin/php.

I'm starting to get the impression that I'm doing something profoundly wrong, so any idea about what that might be, will be greatly appreciated.

Thanks in advance.

  • This is because /usr/bin has a higher precedence in $PATH than your new location. Either remove the /usr/bin/php file from your computer or alter your $PATH variable so the new location appears before /usr/bin – DaveRandom Dec 14 '12 at 15:50
  • 1
    @DaveRandom It's terrible advice to remove /usr/bin/php just to fix path problems. – slhck Dec 14 '12 at 16:51
  • @DaveRandom the result of echo $PATH is this: /Applications/MAMP/bin/php5.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin – Sakis Vtdk Dec 14 '12 at 20:40

It turns out that there was an issue with permissions. Everything was fixed by running this command:

sudo chmod -R 764 /Applications/MAMP/bin/php5.3/bin

| improve this answer | |

The correct path to PHP in MAMP is this:




First view your actual PHP:

which php

If you actual path is: /usr/bin/php you can change with this commands:

In you personal folder:

vim ~/.bash_profile

Then copy this text:

export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH

Type esc and :wq to save & exit.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.