Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from stackoverflow.com Dec 14 '12 at 15:47

This question came from our site for professional and enthusiast programmers.

    
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
up vote 0 down vote accepted

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

share|improve this answer

The correct path to PHP in MAMP is this:

/Applications/MAMP/bin/php/php5.3/bin

NOT

/Applications/MAMP/bin/php5.3/bin

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.

Solved!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .