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.

For some reason using php at the command line references /usr/local/bin/php instead of /usr/bin/php. How can I make $ php script.php the equivalent of running $ /usr/bin/php script.php?

Current setup:

$ which php
/usr/local/bin/php

Desired setup:

$ which php
/usr/bin/php
share|improve this question

migrated from stackoverflow.com Jun 5 '13 at 0:12

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

1  
create a Symbolic link ln -s /usr/local/bin/php /usr/bin/php –  Dagon Jun 4 '13 at 22:12
    
There already is another version of php at /usr/bin/php, so I'd rather not overwrite that with a symbolic link. –  Ryan Jun 4 '13 at 22:20
    
ok, well its just one of many options :-) –  Dagon Jun 4 '13 at 22:25

1 Answer 1

up vote 3 down vote accepted

Either change $PATH to contain /usr/bin first, or use your shell's alias capability to point php to /usr/bin/php.

alias php=/usr/bin/php
share|improve this answer
    
Yay! Thanks so much. –  Ryan Jun 4 '13 at 22:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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