Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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) :


...so 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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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

1 Answer 1

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.