PHP7.1 curl does not work - php

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?

Related

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

I ran apt-get dist-upgrade and my php stop working

I have searched but couldn't find a resource that helped, so I have to say it out loud. Please help me. I mistakenly ran sudo apt-get upgrade -u dist-upgrade
After that, all the websites on my server stopped working. I tried to check if Php is still installed by typing php -vbut I got
-bash: php: command not found
I also tried to reinstall php using
sudo apt-get install php
And I saw this
sudo apt-get install php
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 : Depends: php7.2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Then I tried running
Sudo apt-get install php7.2
And I saw this
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 : Depends: libapache2-mod-php7.2 but it is not going to be installed or
php7.2-fpm but it is not going to be installed or
php7.2-cgi but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I also tried installing the modules: and I get this:
root#matrixpluspluto:~# sudo apt-get install php7.2 php7.2-cli php7.2-c
gi php7.2-fpm libapache2-mod-php7.2 php7.2-opcache
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:
libapache2-mod-php7.2 : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-cgi : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-cli : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-fpm : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
php7.2-opcache : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
E: Unable to correct problems, you have held broken packages.
I checked and saw that libc6 v2.24 is already installed
Please help me. Before this I was using php7.1 after the upgrade I started seeing 7.2. Anything I do concerning php doesn't work out. Pove been trying to fix this for more than 2 days, please help.
Don't know if you solved it yet but I had the same problem.
Solved it by running :
sudo apt-get purge php* .
Note that this is not a good solution but a desperate one. Also I knew what php related packages I had installed, so I wasen't afraid of what the command would purge.
Then I watched what packages are being purged and reintalled them.
Everything working fine for now.

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.

Broken PHP install? Unmet dependencies on any package

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.

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