Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

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

I've just followed this article ( 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 the old version of php (that comes with mountain lion) always run first

Any ideas on how to solve this? Thank you.

share|improve this question

marked as duplicate by slhck Oct 10 '12 at 21:25

This question was marked as an exact duplicate of an existing question.

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

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.

share|improve this answer
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.