去选择下载来源(这里需要选择根据你当前php版本相对应的xdebug版本)
https://xdebug.org/download#releases

我的php版本是7.3版本(当然从php -v 命令可以看到我的xdebugu已经安装成功了)
我这里选择的版本是当前最新版本:Xdebug 3.1.1
- 下载,解压,切换
# wget https://xdebug.org/files/xdebug-3.1.1.tgz
# tar -zxvf xdebug-3.1.1.tgz
# cd xdebug-3.1.1
- 接着(具体可根据find / -name 命令查找到你的phpize和php-config的路径在哪里)
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
3. 编译,安装
make
make test
make install
注意:一定要习惯编译之后 make test 一下,这样只要你当前环境哪里还需要修改;否则会导致安装失败。
4. 安装成功之后

5. 最后将xdebug.so文件添加到你的php.ini文件中

6. 重启php-fpm
service php-fpm restart
7. 执行 php-m 可以看到xdebug安装成功
8. 结束
网友评论