I'm using Ubuntu server 12.04 LTS, nginx, PHP5, PHP5-fpm

Recently I upgraded my PHP from v 5.3 to what I thought would be 5.4 but the package I used was further along than I thought and I ended up with v 5.5. It upgraded with no issues but I really want/need v 5.4 so I changed packages to add-apt-repository ppa:ondrej/php5-oldstable and attempted to roll back to v 5.4. I have a lot of other issues now for example php5-fpm fails to start due to what looks like missing config files. Any attempts I make at resolving some of the issues almost always results in something like the following:

Setting up php5-fpm (5.4.22-1+debphp.org~precise+1) ...
start: Job failed to start
invoke-rc.d: initscript php5-fpm, action "start" failed.
dpkg: error processing php5-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php5-cli (5.4.22-1+debphp.org~precise+1) ...
Error: The new file /usr/share/php5/php.ini-production.cli does not exist!
dpkg: error processing php5-cli (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5-readline:
 php5-readline depends on php5-cli (= 5.4.22-1+debphp.org~precise+1); however:
  Package php5-cli is not configured yet.
dpkg: error processing php5-readline (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                   Errors were encountered while processing:
 php5-fpm
 php5-cli
 php5-readline
E: Sub-process /usr/bin/dpkg returned an error code (1)

I believed that things are pretty well boogered at this point and what I'm really looking to do I suppose is to just start over with PHP but trying to remove and re-install packages makes no difference and I'm not sure what my next step should be. Any help is appreciated.

I haven't installed php on an ubuntu system, but have on my redhat, centos, and scientific linux (all RHEL 6.4 based) systems. I needed php 5.5+ and those systems are still at 5.3.3, so I had to install from source.

I am not necessarily saying that you will have to install from source, but php usually brings along a bunch of sub-packages and you may need to uninstall all of them, clean your repository, and then reinstall 5.3.

One note: I needed 5.5+ (I'm running 5.5.4) because I needed the http server option for php (so I could test code without having it connected up to Appache, TomCat, etc) - earlier versions don't support that.

In case you are interested, I used php to build a web-based cell phone emulator! Of course, it can't make calls, but it can browse the web... Why you ask? It is intended for performance testing our cell phone proxy browsers - http servers running in the cloud that handle the actual web page fetching and rendering for cell phones, reducing phone data overhead by as much as 90%. :-)

I believe I have most of php install and dependencies repaired and or re-installed correctly however I'm still having issues with php5-fpm and haven't been able to test my nginx as a result. I'd like to be able to wipe anything related to php5-fpm and install clean but no matter what I try there is still issues. The biggest issues is that fpm is not recognized as a service and also cannot be started using /etc/init.d/php5-fpm and php5-fpm.sock seems to be MIA.

I finally got it worked out. I ended up having to replace missing files (even if they were blank) and it allowed the removal process to succeed completely and from there is was simply a matter of re-install and configuration.

Great! We're happy you figured this out. Sometimes, without being able to look at the system in detail, advice can only be approximate... :-)

Member Avatar for TKSS

On a side note, in debian, php5 is a metapackage and you use the following to completely remove all packages php5 associated.

dpkg --purge <packagename>

This cycles through all of the packages listed in the metapackage and removes them purging their files as well.

If you want a LAMP server you could save yourself hours of configuration frustration by installing a TurnKey Linux appliance

They have over 100 virtual appliances covering general purpose uses to niche items.

The have a standard LAMP stack.

The also have Lighttpd version.

You just install and GO.

I have used both of these many times and saved myself days of frustration.

sudo apt-get purge php*; sudo apt-get remove php*; sudo apt-get autoremove; sudo apt-get install php5;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.