当前位置:首页 > 操作系统 > MacOs

php – MAC OS El Capitan 10.11:安装XDEBUG

我正在寻找调试PHP脚本的方法.在互联网上我找到了可以用MacGDBp XDebug做的信息.
当我在Shell中使用PECL进行安装时:

<code>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.
</code>

帮我找到解决问题的方法.

解决方法:

XDebug默认可用.只需启用它

1)sudo nano /etc/php.ini(如果该文件尚不存在,则首先是sudo cp /etc/php.ini.default /etc/php.ini)

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

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

3)使用sudo apachectl restart重启apache

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


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐