简体   繁体   English

在特定的 php 版本上安装 xdebug

[英]Install xdebug on specific php version

I'm trying to install xdebug.我正在尝试安装 xdebug。

I've already seen some issues about it (like this one: Installing xdebug with PHP 5.5 ) but it seems outdated and not corresponding to my issue).我已经看到了一些关于它的问题(比如这个: Installing xdebug with PHP 5.5 )但它似乎已经过时并且与我的问题不对应)。

When I try当我尝试

sudo pecl install xdebug

I'm getting the following error我收到以下错误

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update警告:通道“pecl.php.net”已更新其协议,请使用“pecl channel-update pecl.php.net”进行更新

downloading xdebug-2.8.0.tgz...正在下载 xdebug-2.8.0.tgz...

Starting to download xdebug-2.8.0.tgz (238,122 bytes).................................................done: 238,122 bytes开始下载 xdebug-2.8.0.tgz(238,122 字节)...................................... ................完成:238,122 字节

69 source files, building 69个源文件,建筑

running: phpize sh: 1: phpize: not found ERROR: `phpize' failed运行:phpize sh:1:phpize:未找到错误:`phpize'失败

It seems that means phpize isn't installed in my php version这似乎意味着我的 php 版本中没有安装 phpize

php -v

PHP 7.2.24-0ubuntu0.19.04.1 (cli) (built: Oct 24 2019 11:49:39) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24-0ubuntu0.19.04.1, Copyright (c) 1999-2018, by Zend Technologies PHP 7.2.24-0ubuntu0.19.04.1 (cli)(内置:2019 年 10 月 24 日 11:49:39)( NTS ) 版权所有 (c) 1997-2018 The PHP Group Zend Engine v3.2.0,版权所有 (c) 1998- 2018 Zend Technologies with Zend OPcache v7.2.24-0ubuntu0.19.04.1,版权所有 (c) 1999-2018,Zend Technologies

So, some topics seems to tell me to change my php version to download a version with phpsize included.因此,有些主题似乎告诉我更改我的 php 版本以下载包含 phpsize 的版本。 But I was more looking for a way to add phpsize to my current php version but I don't know how to do that.但我更想寻找一种方法将 phpsize 添加到我当前的 php 版本中,但我不知道该怎么做。

Thanks for your assistance谢谢你的协助

If Ubuntu first you need install php dev version:如果 Ubuntu 首先你需要安装 php dev 版本:

sudo apt install php7.x-dev

And then:接着:

sudo pecl install xdebug

I had some problems with xdebug version too. xdebug 版本也有一些问题。 I had to install an specific version for php7.1 using PECL,我必须使用 PECL 为 php7.1 安装特定版本,

I don't really know if your question is already solved but let me share you this webpage, it's the compatibility graph to know wich version works with an specific php versions:我真的不知道您的问题是否已经解决,但让我与您分享这个网页,这是了解哪个版本适用于特定 php 版本的兼容性图表:

https://xdebug.org/docs/compat https://xdebug.org/docs/compat

As far as I know if you want to install the latest xdebug version you can use the repo, but if you need an old version you'll be forced to install it using PECL.据我所知,如果你想安装最新的 xdebug 版本,你可以使用 repo,但如果你需要旧版本,你将被迫使用 PECL 安装它。

Hope you find this answer usefull!希望你觉得这个答案有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM