Reverting PHP-CLI back to default path on Ubuntu, NGINX, HHVM

While experimenting with optimizations on my brand new LEMH (Linux, Nginx, MariaDB, HHVM) stack; I changed the PHP-CLI config to use HHVM for /usr/bin/php by using the following command:

$ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60

At first everything seemed to work fine... but I soon discovered major url rewrite issues with NGINX and wordpress pretty permalinks. I've finally decided to revert back to the default PHP-CLI, opting for a more conventional stack configuration.

So here's my question: What sudo command would one use to revert the PHP-CLI configuration back its default values; such that using sudo php --ini shows:

/etc/php5/cli
/etc/php5/cli/php.ini
/etc/php5/cli/conf.d
etc...

Rather than the current infinite loop; which ends when a root user kills the process during an hhvm service restart.

I've scoured the HHVM documentation forwards and backwards, but have yet to find anything that even hints at a possible solution. Any help/wisdom is greatly appreciated!

Your's,

Perp1exed.


Check what alternatives are there for the php:

$ sudo update-alternatives --list php
/usr/bin/hhvm
/usr/bin/php5

If you don't want to keep hhvm as an option at all, you can do:

$ sudo update-alternatives --remove php /usr/bin/hhvm
update-alternatives: removing manually selected alternative - switching php to auto mode
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode

This will revert your system to original state. If you want to keep the hhvm, then just change the active alternative:

$ sudo update-alternatives --set php /usr/bin/php5
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in manual mode

and that's it.