2

I am trying to install Xdebug to server and pre-requisite in tutorial I am following is php5-dev but I am using php7.0.5 so I tried sudo apt-get install php7.0-dev.

It gives me

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.0-dev : Depends: libpcre3-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tied to install libpcre3 and got a similar message about another package. I don't know what I am doing here so not sure what to do.

Server is Ubuntu 14.04, Nginx 1.9.13, PHP7.0-FPM.

Any advice on what to do to install php dev?

1

5 Answers 5

1

php7.0-dev is not in the trusty repositories (see here), so it stands to reason that some/many of its dependencies won't be in that repository, either.

Easy answer

Upgrade to 16.04 LTS xenial when it is officially released next week April 21, 2016. It has php7.0-dev and all of its dependencies. See here.

Hard answer

You may be able to manually install the dependent packages. If you go to http://packages.ubuntu.com/xenial/php7.0-dev and download each package manually, then install them either using the Software Center or dpkg -i.

I've had mixed success with this process. There's a reasonably chance that you may run into a package that needs a newer core library (e.g. libc6).

Good luck!

9
  • as per today 16.04 still does not have it in the trusted repos Nov 14, 2016 at 13:39
  • @ElzoValugi What do you get if you call apt search php7.0-dev ? I see that package in the list. Nov 14, 2016 at 13:53
  • php-all-dev/xenial,xenial 1:35ubuntu6 all package depending on all supported PHP development packages php7.0-dev/xenial-updates,xenial-security 7.0.8-0ubuntu0.16.04.3 amd64 Files for PHP7.0 module development Nov 14, 2016 at 13:54
  • and I get this on trying to install php7.0-dev: The following packages have unmet dependencies: php7.0-dev : Depends: libpcre3-dev but it is not going to be installed E: Unable to correct problems, you have held broken packages. Nov 14, 2016 at 13:56
  • @ElzoValugi That means you haven't completed a previous installation. You need to call sudo apt-get -f install to fix the broken packages first. Then sudo apt-get update and then try again. Nov 14, 2016 at 14:02
1

I upgraded ubuntu from 14.04 to 16.06.

I had to disable php 5.6 with sudo a2dismod php5.6 and enabled php 7.0 sudo a2enmod php7.0.

The I started receiving the same error message while installing php7.0-dev

This worked fine for me.

sudo apt install libpcre3=2:8.38-3.1 libpcre3-dev=2:8.38-3.1 and then sudo apt-get install php7.0-dev

0

Per AskUbuntu, try dpkg --get-selections | grep hold.

If there are any packages listed, remove them. If that doesn't work, try apt-get autoremove

0

I had the same issue because I upgraded form 14.04 to 16.04 and the library libpcre3 didn't have been upgraded.

Forcing the installation of the version of the this library from Ubuntu 16.04, fixed the issue: sudo apt install libpcre3=2:8.38-3.1 libpcre3-dev=2:8.38-3.1

The installation of php7.0-dev worked nicely: sudo apt install php7.0-dev

0

Have you tried using 'sudo phpdismod xdebug' or 'sudo phpenmod xdebug'?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .