我在安装 OS X 10.9 Mavericks 后在 OS X 上设置我的 PHP 开发环境时遇到问题。
这是我用来安装的命令。
sudo pecl install xdebug
downloading xdebug-2.2.3.tgz ...
Starting to download xdebug-2.2.3.tgz (250,543 bytes)
.....................................................done: 250,543 bytes
66 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:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
有人有解决方案或解决方法吗?
最佳答案
快速复制粘贴方式
sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "xdebug.so") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'
此命令执行以下操作:
- 查找 Xcode 自带的原生 Xdebug 扩展
- 询问 php 加载了哪个配置文件
- 在配置文件中添加 Xdebug 扩展路径
- 重启 apache。
通过捆绑的 apache 与 Sierra、El Capitan 和 Yosemite 兼容,但未经 MAMP 和 XAMPP 测试。
在启动命令之前,请确保已安装 Xcode 命令行工具:xcode-select --install
关于OS X 10.9 Mavericks 上的 PHP Xdebug,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19579401/