Ubuntu 12.04 PHP 5.3 to 5.5 update fails

aptphp5

on a Ubuntu 12.04 Server I´m trying to update PHP 5.3 to 5.5 this is what I have done:

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5

unfortuntely the installation ends with following error:

dpkg: error processing /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2.2-common 2.2.22-1ubuntu1.10
dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems PHP 5 affects Apache 2.2 as well. Thankful for help why the subprocess was killed.

EDIT: I solved this by uninstalling apache2.2 completely and reinstalling 2.4 which worked without errors.

Best Answer

I got same problem when upgrade PHP, you can try this

sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb

and then install php5 by

sudo apt-get -f install php5

this will upgrade apache2, enjoy it.

Related Topic