Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

To use the right PHP version on my command line I want to change the $PATH of my command line profile.

For now, the command line uses the standard system php file located in /usr/bin/. I want to use the php file from my zend server ce located in /usr/local/zend/bin.

I added /usr/local/zend/bin already to my bash_profile but it doesn't work because when I print the $PATH variable, /usr/local/bin comes before /usr/local/zend/bin and the terminal will takes the first one.

My PATH:

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

I tried to update the .bash_profile file but it just include my 'zend' path's. Other path's look likes to set somewhere else or automatic?

Thanks in advance,

Nick

share|improve this question

migrated from stackoverflow.com Nov 29 '12 at 2:49

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

Just prepend zend to your PATH

PATH=/usr/local/zend/bin:$PATH

Don't forget to reload or relogin.

share|improve this answer

Try as follows:

export PATH=/usr/local/zend/bin:$PATH
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .