PHP broken after upgrade

I just upgraded webmin to the latest version on Debian Lenny 5. And upgraded apache to 2.2.9-10+lenny9.

PHP is now broken. It seems that I am not the only one:

How can I downgrade apache to the the latest version that works?


So what problem is it you’re seeing exactly? Are you by chance seeing errors regarding “php_value” in the Apache config?

There’s a known issue where, for reasons unknown to us, apt removes the libapache2-mod-php5 package during certain updates. The fix is to simply reinstall that particular package… you don’t actually need to downgrade any packages.


I had the same problem as the guy in the thread I linked too. PHP wasn’t installed after the apache upgrade. The php files were just downloaded in the browser as is. Not very secure with database passwords in the php code and so…

I uninstalled and reinstalled apache and php5 and things went downhill from there as I used aptitude from the command line, which seemingly was a bad idea as many packages were uninstalled. Could this be a conflict with apt-get which seemingly is what virtualmin uses? Anyway, I reran the virtualmin installer. reinstalled apache and php with apt-get and now all seems to work again.

It’s not generally a “bad idea” to use aptitude to fix packages that were incorrectly uninstalled. You just need to pay close attention to what aptitude tells you it is going to do when you make changes to packages. If it says that it’s going to “remove many packages”, that means “red alert” and you should choose different package manipulations to fix things. :slight_smile:

When aptitude reports package conflicts, it usually suggests several options to fix them. Choose the “least invasive” one, especially don’t choose one that will uninstall half of Virtualmin. :slight_smile:

Glad to hear that aptitude does work.

Lesson learned: I should read the message that says “I am going to remove 100 packages (Y/N)” before typing the Y.

The problem with Linux servers is that they are so reliable. Meaning that less than one time per year I have to look into something, resulting in me (as a Windows programmer) to never learning the basics. And when I know it, I forget about it in the many months or years that the server just hums along. Yesterday was my second 2 hours downtime in 10 years. So overall I am doing not that bad.


If that problem were to ever arise again (it does seem to happen on occasion on Debian-based systems), you can typically resolve it by running this from the command line:

apt-get install libapache2-mod-php5

If for some reason the above doesn’t work, pop a note in the forums here and we can try and figure out what’s going wrong :slight_smile:


There is also another way around this using the debian pinning preferences.

edit /etc/apt/preferences

and add this…

Package: apache2-mpm-worker
Pin: version 1.0*
Pin-Priority: 1001

What happens is that some debian security updates are incorrectly enforcing the install of apache worker instead of what is actually installed which is apache pre-fork. The above setting prevents worker from being installed thus not breaking php.