问题描述
我正在尝试在我最近升级的 Ubuntu 20.04.1 中安装 xdebug
当我将 phpinfo() 的输出放在 https://xdebug.org/wizard 我得到:
Installation Wizard
Summary
Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 7.2.34
Zend API nr: 320170718
PHP API nr: 20170718
Debug Build: no
Thread Safe Build: no
OPcache Loaded: no
Configuration File Path: /opt/lampp/etc
Configuration File: /opt/lampp/etc/php.ini
Extensions directory: /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718
安装推荐我安装版本:xdebug-3.0.1 但是当我按照说明操作时,我从终端收到此错误:
The following packages have unmet dependencies:
php-dev : Depends: php7.4-dev but it is not going to be installed
E: Unable to correct problems,you have held broken packages.
我该如何解决这个问题? 我是否应该安装较旧的 xdebug 包以与我的 php7.2 版本兼容?
提前致谢。
解决方法
我通过在我的 Ubuntu 20.04.1 中安装 php7.2-dev 解决了这个问题
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install php7.2-dev
之后我可以运行 phpize 并且仍然使用 XDebug 3。