在 High Sierra 上使用 PECL 安装 xDebug

Install xDebug with PECL on High Sierra

我刚刚将 mac 从 Sierra 更新为 High Sierra。我按照 instructions 安装了 PECL,我想安装 xdebug 运行 pecl install xdebug.

输出

79 source files, building running: phpize grep:

/usr/include/php/main/php.h: No such file or directory grep /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version: Zend Module Api No: Zend Extension Api No: building in /private/tmp/pear/install/pear-build-rootPkeU2l/xdebug-2.6.0 running: /private/tmp/pear/install/xdebug/configure --with-php-config=/usr/bin/php-config /private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found

include "php.h"

1 error generated. make: *** [xdebug.lo] Error 1 ERROR: `make' failed

问题

我觉得我在安装PECL的过程中可能做错了什么...... 我该怎么办?

财年

php -v

PHP 7.1.16 (cli) (built: Mar 31 2018 02:59:59) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

需要运行这个

 xcode-select --install