mbstring Ubuntu 14.04 dependency package conflict - php

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

Related

Can't install php7.2-ldap on Ubuntu 18.10 - "unmet dependencies"

Recently I'm working with Laravel and LDAP (Active directory) authentication. But I can't install php7.2-ldap, I also tried to install in php7.3 but failed.
Currently I'm using ubuntu v18.10 with multiple php version.
I tried:
$ sudo apt-get install php7.2-ldap
and got this output
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-ldap : Depends: php7.2-common (= 7.2.19-0ubuntu0.18.10.1) but 7.2.20-1+ubuntu18.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried $ sudo apt-get update and upgrade also before do it.
7.2.20-1+ubuntu18.10.1+deb.sury.org+1 is to be installed
deb.sury.org refers to Ondřej Surý PPA, you need to reinstall php following these steps :
You need to have the software-properties-common package installed :
sudo apt-get install software-properties-common
Add the ondrej PPA repo and update sources :
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
Install php and needed extensions :
sudo apt-get install php7.2-common php7.2-ldap
how to : https://pixelspress.com/how-to-install-php-7-2-on-ubuntu-16-04-18-04-18-10/

Need to install libapache2-mod-php onto apache2.2.22

I have to launch old project using apache 2.2.22. (NOT 2.4.x)
So I downgraded from 2.4 to 2.2 and this seems to be OK.
But then I have to install libapache so I use:
apt-get install libapache2-mod-php5
and this results
The following packages have unmet dependencies:
libapache2-mod-php: Depends: apache2-api-20120211
Depends: apache2 (>=2.4)
Does somebody know how to install libapache2-mod-php to the old apache 2.2.22?
Had to set priority of repositories for php* and libapache2-mod-php. Solved.

xdebug installation failure

how can I install XDebug on Ubuntu 14.04?
I tried to install it through apt-get:
sudo apt-get install php5-xdebug
but I get this error:
php5-xdebug : Depends: phpapi-20121212+lfs
E: Unable to correct problems, you have held broken packages.
what's wrong?

Need to install php5.4 on ubuntu 12.04 LTS precise

I am using following instruction to install latest php on unbutu instance:
Add to /etc/apt/source.list
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
Update apt-key
sudo wget -q http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
sudo apt-get update
install apache2 + php
`sudo apt-get install -y apache2 php5 libapache2-mod-php5`
Output:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
Recommends: php5-cli but it is not going to be installed
I need a stable way to install latest php. Previously I was using ppa and decided to not use it bcz of security
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5-oldstable
I wonder if there is a better way to setup latest php+apache2+mysql , I have to script the process to automate the installation and invoke it through build script
Side note/problem background:
I am using Phing ssh task to invoke the script to setup php+apache2+mysql, which break with add-apt-repository command for weird reason
Reference:
<ssh host="${deploy.host}"
username="${deploy.user}"
privkeyfile="${deploy.pem}"
pubkeyfile="${deploy.pub}"
command="${ssh_command}"
display="false"
property="ssh.output"
failonerror="true"
/>
ssh_command where I invoke the script
Further tests:
sudo apt-get install -y apache2 php5 php5-cli libapache2-mod-php5 php5-mysql php5-gd php5-memcache php5-mcrypt php5-xsl
Output:
The following packages have unmet dependencies:
libapache2-mod-php5 : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
php5-cli : Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-5.1ubuntu4 is to be installed
Depends: libedit2 (>= 2.11-20080614-4) but 2.11-20080614-3ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
I had a similar situation.
The place where I was working was using an old version on PHP (5.3.8).
I installed the latest version of Ubuntu in my desktop and then I realised that downgrading from 5.5 to 5.3 was almost impossible, too many dependencies to handle, the best solution I could find was to use an "all-in-one" package like XAMPP.
Even though I hate those solutions I changed my mind after a couple of hours, it did exactly what it was supposed to do, I didn't have to do any sorcery in the package manager or alter any configuration files.
Here is the XAMPP version I would use in your case (1.8.2-3 version - PHP 5.4 based)
It contains
PHP 5.4.22
MySQL 5.5.34
Apache 2.4.7
phpMyAdmin 4.0.9
More info: here and here

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