apt – Can’t install xdebug – Depends: phpapi-20121212 – ubuntu 14.04 – Ask Ubuntu

You’re using manually installed PHP packages that don’t stem from the official repositories. Anything could happen in that case and I suggest that you report the issue to their maintainer.

Solution 1: Switch/downgrade to in-repository packages

The immediate solution is to revert to the in-repository packages with:

sudo apt install php5=5.5.9+dfsg-1ubuntu4.20 php5-xdebug=2.2.3-2build1

If you have other packages depending on that php5version you’ll need to install their respective in-repository versions in the same fashion.

Solution 2: Install PHP 5.6 and xdebug from an actual PPA and not manually with dpkg -i

How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release? has an excellent answer that lists such a PPA.

  1. You probably want to remove the current PHP 5 installation since the PPA packages have different names to allow different independent PHP installations:

    sudo apt remove php5 php5-xdebug
  2. Add the PPA, upgrade your packages and install the new PHP and xdebug packages:

    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
    sudo apt upgrade
    sudo apt install php5.6 php-xdebug

As in the previous solution you’ll need to remove packages that depend on php5 (happens automatically with apt remove php5) and later re-add their php5.6counterparts

The error is as a result of the fact you are loading an xdebug which was compiled with a php versiondifferent from the one installed on your system

And you should look for one that was compiled with the same php version on your system.

Look at this article here for further help.

https://askubuntu.com/questions/856996/cant-install-xdebug-depends-phpapi-20121212-ubuntu-14-04

apt – Can’t install xdebug – Depends: phpapi-20121212 – ubuntu 14.04 – Ask Ubuntu was last modified: July 28th, 2018 by Jovan Stosic

Leave a Reply