0

I have freshly installed Mac OS 10.8 Mountain Lion and I have noticed that the PHP version the system is using is not the one associated to MAMP.

I used to modify my PATH variable to point my OS to use a different BIN folder for PHP but I just cant find where to modify the PATH variable in 10.8 anymore.

I created a .profile and look into the .bash_profile file as well but the OS keeps on using

/usr/bin/php

as the default PHP installation instead of

/Applications/MAMP/bin/php/php5.3.14/bin

Where can I find the system PATH variable setting?

hakre
  • 193,403
  • 52
  • 435
  • 836
MightyMouse
  • 351
  • 1
  • 3
  • 12
  • Try the `which` command: `which php` - maybe Mac OSX has it, I don't know. – hakre Nov 09 '12 at 12:28
  • which php tells me what instance of PHP is the OS using but wont allow me to change it. – MightyMouse Nov 09 '12 at 12:29
  • Please see first: [How to run a PHP script from the command line with MAMP?](http://stackoverflow.com/q/954910/367456) - Take care you have the path to the PHP binary in the MAMP folder *before* the systems binary path. `echo $PATH` should output your current path variable. If you can not solve it your own already, add that output to your question. – hakre Nov 09 '12 at 12:34
  • I would assume you just either did not execute `.bash_profile` so far to update the path (don't call it directly, just open a new shell and try in there) or you placed it at the wrong end (behind instead before the systems `$PATH`) – hakre Nov 09 '12 at 12:36
  • MY path to the PHP binary folder doesnt point to MAMP-PRO. This exactly what I want to do, to change the PATH form the default OS php installation to the MAMP bin path. If I do a "which php" I get "/usr/bin/php" – MightyMouse Nov 09 '12 at 13:18
  • Make your `$PATH` point to it first. What does `echo $PATH` give you so far? – hakre Nov 09 '12 at 13:20
  • /Users/jfernandez/.rvm/gems/ruby-1.9.3-p286/bin:/Users/jfernandez/.rvm/gems/ruby-1.9.3-p286@global/bin:/Users/jfernandez/.rvm/rubies/ruby-1.9.3-p286/bin:/Users/jfernandez/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin – MightyMouse Nov 09 '12 at 13:21

1 Answers1

0

For me I can edit my ~/.profile file in mountain lion. I'm not sure where the original PHP path is located but you could try adding export PATH="$PATH:/Applications/MAMP/bin/php/php5.3.14/bin" to your .profile file. Make sure to restart your terminal before running which php.

alana314
  • 633
  • 8
  • 11