在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之后就可以正常安装了。
解决PHP 7.4安装xdebug出现configure: error: rtnetlink.h is required, please…-小白菜博客
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]
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的配置