2

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.

Sakis Vtdk
  • 121
  • 4
  • 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

2 Answers2

0

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

Sakis Vtdk
  • 121
  • 4
0

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!