I want to purge PHP completely from my Ubuntu 16.04. I have did all the stuff to remove PHP which as below,
sudo apt-get purge "php*"
sudo apt-get purge "^php.*"
sudo apt-get purge "^php*"
sudo apt-get remove "php*"
sudo aptitude remove ~iphp
sudo aptitude search "~iphp"
rm -rf /etc/php/
Although when I check from the terminal and run php -v
it still shows the PHP 5.4.15 (cli).
Does have any idea about this?
Best Answer
From your comments, looks like
php
was installed either via source code or with some kind of binary distribution, but not viaapt
/dpkg
.To uninstall it, you should first know how it was installed!
Usually, if via source code, you should find a directory under
/usr/src
or/usr/local/src
(or yourhome
, or...) containing the said source code (maybe/usr/src/php-X.Y.Z
).Then it (usually!) will be enough to use
make uninstall
, but you should check the source code documentation for the proper procedure.If it was installed via a binary distribution, there might be an uninstall command (try looking in
/usr/local/bin
) or you should proceed to manually delete every file/directory.If you didn't install
php
yourself, you should ask who installed it which method was used and acting accordingly.EDIT as per comments
Looks like you installed it via source code, so to uninstall it you can try