Skip to content


Midnight maintenance: undoing a PHP upgrade in Debian

For some reason, the latest PHP upgrade from Dotdeb (version 5.4.9) brought some terrible performance drop on this server. Several seconds to load any blog notepad page, and 16 seconds to finish page loading on Sorties Fever. Plus it appeared as I was doing some code changes, so I first got lost in my changelog, undoing stuff there (like, “wtf did I do wrong?”) before noticing the problem was server-wide. Gladly, someone else also reported the problem (without them, maybe I’d still be hitting my head on the wall – although the undegraded performance on the test server was a big clue too ^^). Hence the solution: downgrade PHP back to the version that used to work.

Easier said than done: apt-get doesn’t has a proper downgrade mechanism. So here’s the walkthrough:
1. Grab older packages. If you’re lucky (as in, if you don’t cleanup your installation files too often), you’ll find them in /var/cache/apt/archives
2. Know which packages to downgrade. For this, the easiest way I found was to list all archived packages by date (command: ls -lrt): the files added today are the packages I upgraded today, and for which I’ll have to find an old version…
3. Perform the downgrade package by package: dpkg -i [name of your package], like dpkg -i libapache2-mod-php5filter_5.4.8-1~dotdeb.0_amd64.deb

And that’s pretty much it, actually đŸ™‚ Good night now…

Posted in Linux, servers.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA