1

I'm trying to update where the command line gets the location of the php binary:

webserver: /usr/bin

cli: /opt/local/bin/php

Where can I edit so when I do 'which php' it shows me /usr/bin/php

chrisan
  • 957
  • 1
  • 8
  • 12

2 Answers2

2

In your .bashrc

export PATH=/usr/bin:$PATH
  • Didn't change. I logged in as my normal user and was at the home directory, did nano .bashrc and added the above line (file was empty) I also checked .bash_profile and it had export PATH=$PATH:/usr/bin:(other paths here) –  Sep 22 '11 at 23:47
  • Remove the .bashrc change, and edit your .bash_profile instead so that /usr/bin is first. –  Sep 23 '11 at 00:07
0

It won't change the actual location, but you can make a symbolic link (shortcut) using the ln program.

sudo ln -s /opt/local/bin/php /usr/bin/php

That makes a shortcut from /opt/local/bin/php to /usr/bin/php. It's cleaner and more straightforward than having duplicate files or adding a directory to your PATH, in my opinion.

apricot boy
  • 121
  • 5