php - MAC 操作系统 El Capitan 10.11 : Install XDEBUG

标签 php xdebug osx-elcapitan pecl

我正在寻找调试 php 脚本的方法。在互联网上,我发现我可以使用 MacGDBp + XDebug 来做到这一点。 当我尝试在 Shell 中使用 PECL 安装时:

sudo pecl install xdebug

The next error have been occured:

downloading xdebug-2.4.0.tgz ...

Starting to download xdebug-2.4.0.tgz (264,832 bytes)
.....................done: 264,832 bytes

76 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.

帮我找到解决这个问题的方法。

最佳答案

XDebug 默认可用。只需通过

启用它

1) sudo nano/etc/php.ini(如果文件没有,则先 sudo cp/etc/php.ini.default/etc/php.ini '还存在)

2) 在末尾添加这些行(使用 ls ls/usr/lib/php/extensions/ 验证路径)

[Xdebug]
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"

3) 使用sudo apachectl restart 重启apache

4) 通过 php -m | 验证grep xdebug

关于php - MAC 操作系统 El Capitan 10.11 : Install XDEBUG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36886982/

相关文章:

docker - 在 Docker 和 PhpStorm 中安装 Xdebug 时出现问题

Docker - Xdebug 调试 PHP CLI 脚本(VS 代码)

ios - Xcode 6.4/7 在 El Capitan 测试版后崩溃

php - 如何在 Laravel 中按特定值排序?

php - 如何在提交时弹出联系表单在弹出窗口中显示确认消息?

php - 什么是 Linux 服务器中的 B4TM4N SH3LL PHP WEBSHELL

node.js - 安装 MAC OS X El Capitan 后出错

php - 如果未修改,使 PHP 页面返回 "304 Not Modified"

php - 打印执行的 PHP 代码(采用的代码路径)

objective-c - 如何在 Mac (Cocoa) 应用程序中实现夜间模式?