mac php安装xdebug扩展

  • 下载xdebug文件

1.将phpinfo();的信息全部输入网址中的框,得到适配的xdebug版本:

网址:http://xdebug.org/wizard.php

2.下载并解压

sudo tar -zxvf xdebug-2.7.0.tgz
 
cd xdebug xdebug-2.7.0

3.配置

configure

make

执行make报错

/bin/sh /Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/libtool --mode=compile cc   -I. -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0 -DPHP_ATOM_INC -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/include -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/main -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/xdebug.c -o xdebug.lo
mkdir .libs
 cc -I. -I/Users/xuce/Downloads/xdebug-2.7.0/xdebug-2.7.0 -DPHP_ATOM_INC -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/include -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/main -I/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/xdebug.c  -fno-common -DPIC -o .libs/xdebug.o
/Users/Downloads/xdebug-2.7.0/xdebug-2.7.0/xdebug.c:25:10: fatal error: 'php.h' file not found
#include "php.h"
         ^~~~~~~
1 error generated.
make: *** [xdebug.lo] Error 1

执行

brew doctor
 
brew link --overwrite php
 
//执行完后,重新执行phpize
 
phpize
 
./configure  --with-php-config=/usr/bin/php-config

问题得以解决

修改php.ini增加

zend_extension=/usr/local/lib/php/pecl/20170718/xdebug.so

然后重启php-fpm

php -m 查看是否安装成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值