Search code examples
phpmacosmampbash

trying to use MAMP's PHP, but `which php` always returns native OSX version?


I want to use MAMP on my OSX box as I am learning Laravel development.

I have added the following line to ~/.bash_profile:

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

I restarted terminal, restarted MAMP, but when I run which php the result is still /usr/bin/php.

Any tips? Thanks!


Solution

  • Your path can be changed, while the default OS response to the which command remains unchanged.

    Example:

    which php

    /usr/bin/php

    php

    bash: Applications/MAMP/bin/php: No such file or directory

    Run this command:

    echo "$PATH"

    [NOT a complete answer]