H2S Forum

How to completely remove php 5.6, php 7.0 & php 7.2 from ubuntu

If you want to remove any installed version of PHP completely from the Ubuntu or Debian based Linux operating system then simply use the below command:

sudo apt-get purge 'php*'

to completely remove some particular version, mention that version in the above command:

For 7.2

The below command will purge or remove all PHP files related to 7.2

sudo apt-get purge 'php7.2*'

In the same way:

sudo apt-get purge 'php7.0*'
sudo apt-get purge 'php5.6*'