Mac+Apache+PHP安装Xdebug方法步骤

发布时间:2022-05-15 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Mac+Apache+PHP安装Xdebug方法步骤脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

MAC homebrew自2018/3/31之后弃用homebrew/php

By 31st MArch 2018 we will dePRecate and archive the Homebrew/php tap. Unfortunately we have been unable to maintain an acceptable, consistent user or contributor experience and CI workload through non-core formula taps in the Homebrew organisation so we are continuing to migrate widely used formulae into Homebrew/core and encourage more niche formulae and options to be supported outside the Homebrew organisation.

详细:https://brew.sh/2018/01/19/homebrew-1.5.0/

所以不能再用下面的方法安装xdebug了,下面的方法不行!下面的方法不行!下面的方法不行!

brew install php<version number>-xdebug

所以,安装xdebug我们可以手动编译一下,具体步骤如下:

1.首先进入 Xdebug 官方下载页面:https://xdebug.org/download.php,下载安装phP版本支持的xdebug的版本

eg.我本地的PHP版本是5.6.38,所以下载了2.5.4的source,一个tgz压缩包

2.在下载xdebug的文件夹里打开终端

tar -xzf xdebug-2.5.4.tgz
cd xdebug-2.5.4

也可以在本地直接解压,再进入解压的xdebug的文件夹里,打开终端

phpize

#如果不可以,写phpize的完整路径

./configure

上面命令执行之后,开始编译

make -j2

编译完成之后,会提示,在modules可找到xdebug.so文件

faed9245dcd9cc63a927ceac0283e52.png

3.将编译之后得到的xdebug.so文件可以拷贝到extension_dir规定的文件夹中

注:php.ini 中搜索extension_dir

4.在Php.ini中配置一下参数

[Xdebug]
zend_extension="/usr/local/lib/php/PEcl/20131226/xdebug.so"
;自动跟踪,可关闭(关闭后提升性能)
xdebug.auto_trace=On
;性能分析,可关闭(关闭后提升性能)
xdebug.profiler_enable=On
xdebug.VAR_display_max_children=512
xdebug.var_display_max_data=2048
xdebug.var_display_max_depth=8

修改完之后,重启apache,phpinfo()检测一下安装上了没,应该是没问题了

更多php相关知识,请访问php教程!

以上就是Mac+Apache+PHP安装Xdebug方法步骤的详细内容,更多请关注脚本宝典其它相关文章

脚本宝典总结

以上是脚本宝典为你收集整理的Mac+Apache+PHP安装Xdebug方法步骤全部内容,希望文章能够帮你解决Mac+Apache+PHP安装Xdebug方法步骤所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: