Broken PHP install? Unmet dependencies on any package - php

I need to enable APC on my server, however not a single package will install (even php5 says it has unmet dependencies but is installed already)
The error I am getting says it will not install the packages. I tried -f and --fix-missing to no avail
apt-get -f install php5 php5-fpm php-pear php5-common php5-mcrypt php5-mysql php5-cli php5-gd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php5-cli : Depends: libdb5.1 but it is not installable
Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-2+squeeze8 is to be installed
Depends: libedit2 (>= 2.11-20080614-4) but 2.11-20080614-2 is to be installed
php5-common : Depends: psmisc (>= 22.15-1~) but 22.11-1 is to be installed
php5-fpm : Depends: libdb5.1 but it is not installable
Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-2+squeeze8 is to be installed
php5-gd : Depends: libjpeg8 (>= 8c) but it is not going to be installed
php5-mcrypt : Depends: libltdl7 (>= 2.4.2) but 2.2.6b-2 is to be installed
php5-mysql : Depends: libmysqlclient18 (>= 5.5.24+dfsg-1) but it is not going to be installed
E: Broken packages

“It is not installable“ means APT does not know where to get this package. You either have incompatible sources in /etc/apt or you need to update the package cache with apt-get update.

Related

what is the process to install php7.2-dev extension?

I am trying to install php7.2-dev but it depends upon dependencies i have search a lot on those but can't resolve the issue.
sudo apt install php7.2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php7.2-dev : Depends: autoconf (>= 2.63) but it is not installable
Depends: automake (>= 1.11) but it is not installable
Depends: libssl-dev but it is not installable
Depends: pkg-config but it is not installable
Depends: shtool but it is not installable
Depends: libtool (>= 2.4.6-0.1~) but it is not installable
Recommends: pkg-php-tools but it is not installable
E: Unable to correct problems, you have held broken packages.

mbstring Ubuntu 14.04 dependency package conflict

I am trying to install PHP mbstring module in my Ubuntu 14.04 machine. I've used "sudo apt-get -f install php7.0-mbstring" to install the module. I've added necessary source list in "/etc/apt/sources.list".
When I run the above mbstring installation command I get the following error.
The following packages have unmet dependencies:
php7.0-mbstring : Depends: php7.0-common (= 7.0.33-0ubuntu0.16.04.6) but 7.0.21-1~ubuntu14.04.1+deb.sury.org+1 is to be installed
Conflicts: php7.0-mbstring:i386 but 7.0.33-0ubuntu0.16.04.6 is to be installed
php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable
Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not going to be installed
Depends: libc6:i386 (>= 2.4) but it is not going to be installed
Conflicts: php7.0-mbstring but 7.0.33-0ubuntu0.16.04.6 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
What is the recommended solution here? Do I need to uninstall PHP 7.0 and reinstall or is there any other low risk solution?
Edit: I've tried to install with sudo apt-get -f install as well. I get the same following error,
php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable
Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not installed
Depends: libc6:i386 (>= 2.4) but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
First be sure that your package list is up to date, try:
sudo apt-get update
After it try install packeage again
sudo apt-get install php7.0-mbstring
If it doesn't help try to add php repository to source list, for example you can use this PPA
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0-mbstring

PHP7.1 curl does not work

I have tried to install php7.1-curl but I get only this response:
The following packages have unmet dependencies:
php7.1-curl : Depends: php7.1-common (= 7.1.8-1) but 7.1.1-1 is to be installed
Depends: libcurl3 (>= 7.44.0) but 7.38.0-4+deb8u5 is to be installed
E: Unable to correct problems, you have held broken packages.
Can anyone help me?

Cannot install cURL and PHP's cURL library on Ubuntu 14.04

I'm trying to install curl and php5-curl on a Ubuntu 14.04 server, but I'm getting the following error:
sudo apt-get install libcurl3 php5-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl3 is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libapparmor-perl : Depends: perl-base (>= 5.18.2-2ubuntu1) but 5.14.2-6ubuntu2.5 is to be installed
Depends: perlapi-5.18.2
libcgi-fast-perl : Depends: libfcgi-perl but it is not going to be installed
libdbd-mysql-perl : Depends: perlapi-5.18.1
libdbi-perl : Depends: perlapi-5.18.1
liblocale-gettext-perl : PreDepends: perl-base (>= 5.18.1-4) but 5.14.2-6ubuntu2.5 is to be installed
PreDepends: perlapi-5.18.1
libperl5.18 : Depends: perl-base (= 5.18.2-2ubuntu1.1) but 5.14.2-6ubuntu2.5 is to be installed
libsub-name-perl : Depends: perlapi-5.18.1
libterm-readkey-perl : Depends: perlapi-5.18.1
libtext-charwidth-perl : Depends: perl-base (>= 5.18.1-4) but 5.14.2-6ubuntu2.5 is to be installed
Depends: perlapi-5.18.1
libtext-iconv-perl : Depends: perl-base (>= 5.18.1-4) but 5.14.2-6ubuntu2.5 is to be installed
Depends: perlapi-5.18.1
libtext-soundex-perl : Depends: perlapi-5.18.1
perl : Depends: perl-base (= 5.18.2-2ubuntu1.1) but 5.14.2-6ubuntu2.5 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Ran apt-get -f install by itself and it fixed the problems. I miss understood the -f install and thought I needed to run it with the package with it. It wound up updating everything and even installed other packages I was trying to install.
Thanks for the help.

Way to Install the MongoDB PHP Driver

I'm trying to enable PHP for Mongo DB. Solution for that is same (install php5-dev first) in every forums but to installation fails with error.
Any idea how to solve issue?
Note: Using Ubuntu 12:04
jojo#ubuntu:~$ sudo apt-get install php-pear php5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php-pear : Depends: php5-cli but it is not going to be installed
php5-dev : Depends: autoconf (>= 2.63) but it is not installable
Depends: automake (>= 1.11) but it is not installable
Depends: libtool (>= 2.2) but it is not installable
Depends: shtool but it is not installable
E: Unable to correct problems, you have held broken packages.
jojo#ubuntu:~$
Assuming you have already installed MongoDB, You can install PHP driver for MongoDB by this command
sudo apt-get install php5-mongo
sudo apt-get install php5-mongo
worked on PHP 5.5.9 / Ubuntu 14.04 LTS
I would suggest to do this:
apt-get update
apt-get upgrade
And then install:
apt-get install php5-cli php5-dev
And then:
apt-get install php-pear
pecl install mongo
I created a fresh content for sources.list using this page and then installed Synaptic Package Manager to install new stuff which solved the problem..
This seems less like an issue with installing php5-dev, or even the mongo extension, and more with the following conflicts:
Depends: autoconf (>= 2.63) but it is not installable
Depends: automake (>= 1.11) but it is not installable
Depends: libtool (>= 2.2) but it is not installable
Depends: shtool but it is not installable
You can get some more information on these with sudo aptitude show <package>, which may clue you in on other installed packages that they conflict with. From personal experience, I've only had to install the build-essential package to do any C/C++ compiling on Ubuntu. That high-level package usually ends up covering these dependencies.
http://docs.mongodb.org/ecosystem/drivers/php/
This link gives all commands we need to execute for different operting system to install php driver for mongoDb

Categories