王柳 发表于 2024-8-19 19:01:46

解决PHP 7.4安装xdebug出现configure: error: rtnetlink.h is required, pl

在PHP 7.4中安装xdebug,出现"configure: error: rtnetlink.h is required, please make sure it is available by installing the correct package"的问题。
在使用sudo yum install kernel-devel 安装完内核devel后还是报错。
之后发现要安装的是xdebug 3.3 的版本,但是xdebug 从3.2开始就已经不支持php 7.4了,固然不知道是不是这个原因导致的,但是切换到3.1之后就可以正常安装了。
https://img2024.cnblogs.com/blog/3504587/202408/3504587-20240819200541991-63531351.png
This is the first release of Xdebug 3.2. This release adds support for PHP 8.2, and drops support for PHP 7.2 through PHP 7.4.
附:https://xdebug.org/announcements
同时附带相关php.ini文件以备查询:
zend_extension=/usr/local/php7.4/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so

xdebug.mode=debug,develop
xdebug.discover_client_host =true
xdebug.idekey="PHPSTORM"
;remote_host和remote_enable另有remote_port 已经变为 client_host client_port
xdebug.remote_host="192.168.182.1"
xdebug.remote_enable=1
;xdebug.remote_port =9003
;xdebug.remote_log =/tmp/xdebug.txt
;上面的remote选项已经失效,使用client
xdebug.client_host="192.168.182.1"
xdebug.clent_port=9003
xdebug.default_enable=0
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.coverage_enable=0
xdebug.remote_autostart=0
之前不停在使用php 5x的版本安装和使用xdebug 2 ,在xdebug3中,有了开关 xdebug.mode=debug,develop ,默以为develop,不支持step,需要设置这个开关,
同时有一个 开关discover_client_host 需要注意,官方形貌为:If enabled, Xdebug will first try to connect to the client that made the HTTP request. It checks the $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR'] variables to find out which hostname or IP address to use.也就是说开启开关后可以自动实验毗连到发起请求的客户端,而client_host 配置则为回退选项,也就是说如果无法毗连则使用client_host的配置

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 解决PHP 7.4安装xdebug出现configure: error: rtnetlink.h is required, pl