Trying to upgrade PHP from 5.3 to 5.6 using the following:
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install php5-common
When I try this, I run into this error and not sure how to resolve:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: apache2-api-20120211
Depends: apache2 (>= 2.4)
Depends: php5-json
php5-cli : Depends: php5-common (= 5.3.10-1ubuntu3.21) but 5.6.18+dfsg-1+deb.sury.org~precise+1 is to be installed
php5-common : Breaks: php5-xdebug (< 2.2.2) but 2.1.0-1 is to be installed
php5-curl : Depends: php5-common (= 5.3.10-1ubuntu3.21) but 5.6.18+dfsg-1+deb.sury.org~precise+1 is to be installed
php5-gd : Depends: php5-common (= 5.3.10-1ubuntu3.21) but 5.6.18+dfsg-1+deb.sury.org~precise+1 is to be installed
php5-intl : Depends: php5-common (= 5.3.10-1ubuntu3.21) but 5.6.18+dfsg-1+deb.sury.org~precise+1 is to be installed
php5-mysqlnd : Depends: php5-common (= 5.3.10-1ubuntu3.21) but 5.6.18+dfsg-1+deb.sury.org~precise+1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
If I try to precede the upgrade by doing sudo apt-get install python-software-properties
then I get this error:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: apache2-api-20120211
Depends: apache2 (>= 2.4)
Depends: php5-common (= 5.6.18+dfsg-1+deb.sury.org~precise+1) but 5.3.10-1ubuntu3.21 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
If I try sudo apt-get apache2
, I get this error:
The following packages have unmet dependencies:
apache2 : Depends: apache2-bin (= 2.4.16-4+deb.sury.org~precise+4) but it is not going to be installed
Depends: apache2-utils (>= 2.4)
Depends: apache2-data (= 2.4.16-4+deb.sury.org~precise+4) but it is not going to be installed
Conflicts: apache2.2-bin but 2.2.22-1ubuntu1.10 is to be installed
Conflicts: apache2.2-common but 2.2.22-1ubuntu1.10 is to be installed
libapache2-mod-php5 : Depends: apache2-api-20120211
Depends: php5-common (= 5.6.18+dfsg-1+deb.sury.org~precise+1) but 5.3.10-1ubuntu3.21 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I tried doing sudo apt-get -f install
as suggested, but does not resolve problem. Instead, I get this:
The following extra packages will be installed:
apache2 apache2-bin apache2-data apache2-utils dh-php5 libedit2 libgd3 libmemcached11 libvpx1 php5-cli php5-common php5-curl php5-dev php5-gd php5-intl php5-json php5-mcrypt php5-memcached php5-mysqlnd php5-xdebug pkg-php-tools
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom libgd-tools php5-user-cache dh-make
Recommended packages:
php5-readline
The following packages will be REMOVED:
apache2-mpm-prefork apache2.2-bin apache2.2-common
The following NEW packages will be installed:
apache2-bin apache2-data dh-php5 libgd3 libmemcached11 libvpx1 php5-json pkg-php-tools
The following packages will be upgraded:
apache2 apache2-utils libedit2 php5-cli php5-common php5-curl php5-dev php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-xdebug
13 upgraded, 8 newly installed, 3 to remove and 10 not upgraded.
8 not fully installed or removed.
Need to get 0 B/7,060 kB of archives.
After this operation, 3,685 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 149017 files and directories currently installed.)
Unpacking apache2-bin (from .../apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb) ...
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)
Also tried doing just sudo apt-get install php5
but get essentially the same error.
What is the correct way to resolve these dependencies issues?
You can Give try with:
Then Add by typing:
Then update by typing:
Then install by typing:
Check PHP Verision:
Still getting please error please try :
Download libapache2-mod-php5 http://packages.ubuntu.com/trusty/libapache2-mod-php5
Install by Typing:
Enjoy!
You must install too the Apache server in 2.4 version minimum. I don't think the PPA will provide you this package. So it break the dependancy. Then you will be able to install the php-common package.