PHP添加Xdebug扩展的方法

前端之家收集整理的这篇文章主要介绍了PHP添加Xdebug扩展的方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

xdegug是一个很好的PHP调试扩展,安装方法也很简单,基本和其他的扩展安装方式差不多.

一、下载对应的DLL

下载地址: 里面选择对应的php版本以及windows 32/64位 版本

二、把文件放在PHP安装目录下的ext文件夹中 也可以自定义。

三、修改php.ini

代码如下:
PHP_xdebug-2.2.3-5.3-vc9-nts.dll" ;以下是参数 xdebug.auto_trace=on xdebug.collect_params=on xdebug.collect_return=on xdebug.trace_output_dir="./xdebug" xdebug.profiler_enable=on xdebug.profiler_output_dir="./xdebug"

配置实例

[Xdebug] ;zend_extension_ts = "X:\upupw\PHP5\ext\PHP_xdebug.dll" xdebug.collect_params = 1 xdebug.collect_return = 1 xdebug.auto_trace = 0 xdebug.trace_output_dir = "X:\upupw\xdebug\trace" xdebug.profiler_enable = 0 xdebug.profiler_output_dir = "X:\upupw\xdebug\profiler" xdebug.max_nesting_level = 100 xdebug.remote_enable = 1 xdebug.remote_host = localhost xdebug.remote_port = 9000 xdebug.remote_handler = dbgp

注意:

xdebug.trace_output_dir="./xdebug" 配置是把调试文件放在PHP安装目录下的xdebug文件夹中,所以要在PHP安装目录下新建xdebug文件

xdebug.profiler_output_dir="./xdebug" 配置是把调试文件放在所运行项目下的xdebug文件夹中,所以要在项目目录下新建xdebug文件

重启网站服务器,可以echo PHPinfo()查看是否有xdebug扩展,有便是安装成功了。

测试

新建PHP文件

代码如下:
运行查看PHP安装目录下的xdebug文件夹中是否生成文件生成文件则安装成功

原文链接:https://www.f2er.com/php/25144.html

猜你在找的PHP相关文章