Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Added a repository so that I could move from PHP 5.3 to 5.5 easily in Ubuntu 12.04.3 LTS. After adding the PPA and following most of the suggestions here it seemed that the PPA didn't handle the upgrade well enough or something was a bit off and things weren't working even after making the necessary config changes post-upgrade.

I removed the PPA and purged a few things and then reinstalled, however things seem even more off now and I can't seem to get back to a proper working state. I backed up all of my configs and have only been trying to get things working as before to no avail. For example:

myusername ~ $ sudo service php5-fpm stop
php5-fpm: unrecognized service
myusername ~ $ sudo /etc/init.d/php5-fpm stop
sudo: /etc/init.d/php5-fpm: command not found
myusername ~ $ ls -al /etc/init.d/php5-fpm
lrwxrwxrwx 1 root root 21 Dec 12 17:00 /etc/init.d/php5-fpm -> /lib/init/upstart-job

I'm not sure how else to go about reverting things, and more than happy to fall back on defaults and drop my configs back but I don't think I've been successful at undoing the upgrade.

How can I repair things, or get things back to a sane working state?

share|improve this question
up vote 1 down vote accepted

My solution to get things back in working order:

  1. Backup config files in /etc/apache2 and /etc/php5 (sites-available, pools, inis, etc)
  2. Remove the old PPA:

    sudo add-apt-repository --remove ppa:ondrej/php5

  3. Find all PHP / Apache packages:

    dpkg --get-selections | grep 'apache\|php'

  4. Remove all PHP / Apache packges and their config files (you backed things up, right?:

    sudo apt-get purge [package name from dpkg list]

  5. Clean apt stuff, for good measure:

    sudo apt-get clean

  6. Check the system for PHP and Apache files:

    sudo find / -name php; sudo find / -name apache

  7. In my case, there was a symlink in /etc/init.d for php-fpm so I removed that:

    sudo rm /etc/init.d/php5-fpm

  8. Since the PPA was removed, ran an update:

    sudo apt-get update

  9. Reinstalled PHP/Apache:

    sudo apt-get install apache2 php5 php-apc php-fpm

  10. Moved config files back

  11. Enabled some Apache mods like mod_proxy

And that took a broken, whiny system back into a clean state. Everything's working beautifully again, hope this helps someone.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.