看了官网安装xdebug(xdebug.org/docs/instal…)只需要执行以下命令
pecl install xdebug
但是版本过低
pecl/xdebug requires PHP (version >= 8.0.0, version <= 8.2.99), installed version is 7.4.33
No valid packages found
install failed
于是乎,需要安装指定版本
pecl install xdebug-2.9.8
downloading xdebug-2.9.8.tgz ...
Starting to download xdebug-2.9.8.tgz (245,293 bytes)
...................................................done: 245,293 bytes
91 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
configure.ac:18: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
build/php.m4:2110: PHP_CONFIG_NICE is expanded from...
configure.ac:18: the top level
configure.ac:161: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:161: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
.....
Build process completed successfully
Installing '/usr/local/Cellar/php@7.4/7.4.33_1/pecl/20190902/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.9.8
Extension xdebug enabled in php.ini
安装控制台提示扩展配置自动加载到php.ini
执行
php -m
[Zend Modules]
Xdebug
Zend OPcache