0

Possible Duplicate:
What are PATH and other environment variables, and how can I set or use them?

I've just followed this article (http://mac.tutsplus.com/tutorials/server/upgrading-the-native-php-installation-on-os-x-mountain-lion/) to update my php installation using HomeBrew. The latest php version is indeed installed in /usr/local/bin The problem is that my $PATH variable is the following (doing an echo $PATH reveals it) :

/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

...so the old version of php (that comes with mountain lion) always run first

Any ideas on how to solve this? Thank you.

skiabox
  • 274
  • 2
  • 5
  • 18
  • 1
    See [Set environment variables on Mac OS X Lion](http://stackoverflow.com/questions/7501678/set-environment-variables-on-mac-os-x-lion) and [How To Edit Your PATH Environment Variables On Mac OS X](http://hathaway.cc/2008/06/how-to-edit-your-path-environment-variables-on-mac-os-x/) – Karan Oct 10 '12 at 21:11
  • I have seen these links already but they don't answer my specific need.I don't want just to add a path to the $PATH variable.I want to know if I can change the order of the paths in the variable and if this action can harm the stability of my system. – skiabox Oct 10 '12 at 21:48
  • 1
    You can simply add the path again, before the rest, in your bash profile. Changing it system-wide wouldn't be necessary. – slhck Oct 11 '12 at 13:21

1 Answers1

0

Create ~/.MacOSX/environment.plist as described here, if it doesn't already exist. Open the file in Plist Editor and add a variable PATH with a value /usr/local/bin:$PATH. Log off and back on so that the changes become effective.

Ansgar Wiechers
  • 5,400
  • 2
  • 21
  • 23
  • There's no need to change the `environment.plist` just to change the path for shells. Editing `.bash_profile` is enough here. There's no Plist Editor by default on OS X, by the way. – slhck Oct 10 '12 at 21:24