Ubuntu 12.04 apt-get purge php5 doesn’t seem to remove php5

aptphp5ubuntu-12.04

I recently made the mistake of upgrading to php5.5 without reading more up on it. It obviously broke my install of apache2.2.

I'm in the process of trying to downgrade back to php5.3 or preferable php5.4.

I've run apt-get purge php5 (and php*) it looks like the purge was successful however I can still run php5 -v and get results plus the results still say php5.5.15.

I even re-ran tasksel and unchecked LAMP.
same results.

I feel like i'm missing something obvious but for the life of me i can't figure it out.

Thought?

Best Answer

You have removed (purged) only the base php5 package. Php binary comes with php5-cli, so you probably didn't remove other php packages. You can check that by running:

 # dpkg -S `which php5`
 php5-cli: /usr/bin/php5

If you don't get the package name, then it's possible that php5 is installed from source.

Another option is that, when you run 'apt-get purge php*' - there were some php* files in your current working directory which would result in shell expansion, and wouldn't run the command you expect to run. For example if you had files php-foo,php-bar in your CWD at the time of running apt-get purge php* that would have expanded to:

apt-get purge php-foo php-bar

It is also advisable to list all php packages to check what are you actually having installed on your system:

# dpkg -l | grep php | sort