1、 采用pecl安装(xdebug官网推荐)
pecl install xdebug-2.6.0
2、 pecl: command not found Mac
本地无pecl,需下载安装
- 下载
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
- 安装
1、Type 1 and press return.
2、Enter:
/usr/local/pear
3、Type 4 and press return.
4、Enter:
/usr/local/bin
5、Press return
3、 安装xdebug-2.6.0
sudo pecl install xdebug-2.6.0
报错: fatal error: 'php.h' file not found
原因: 缺少php.h 创建软连接
解决办法:通过Xcode创建软链接
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include /usr/include