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
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
In your .bashrc
export PATH=/usr/bin:$PATH
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.