您的位置:首页 > 编程语言 > PHP开发

windows下php5.4开启xdebug 或者是新安装xdebug

2013-11-05 09:48 543 查看
网上说5.4版本配置xdebug会有错,可能是因为版本对应的问题,的确很难配对,下面是我配置5.4成功的记录:

1:下载php

使用的是php-5.4.8-Win32-VC9-x86.zip版本, 下载地址:http://windows.php.net/download/

2: 下载xdebug

使用版本:Xdebug 2.2.1
PHP 5.4 VC9 (32 bit) ,解压放到php根目录下的ext文件夹,下载地址:http://xdebug.org/download.php

3:修改php.ini

zend_extension="E:/work/Server/PHPCore/ext/php_xdebug-2.2.1-5.4-vc9.dll"			;载入Xdebug

[Xdebug]											;xdebug配置

xdebug.profiler_enable=on
xdebug.trace_output_dir="E:/work/Server/PHP_XDebug"       					;xdebug 的数据文件目录

xdebug.profiler_output_dir="E:/work/Server/PHP_XDebug"    					;xdebug 的数据文件目录

xdebug.auto_trace = On										;开启自动跟踪
xdebug.show_exception_trace = On								;开启异常跟踪
xdebug.remote_autostart = On									;开启远程调试自动启动
xdebug.remote_enable = On									;开启远程调试
xdebug.remote_handler=dbgp                							;用于zend studio远程调试的应用层通信协议

xdebug.remote_host=127.0.0.1              							;允许连接的zend studio的IP地址

xdebug.remote_port=9000                  							;反向连接zend studio使用的端口
xdebug.collect_vars = On									;收集变量
xdebug.collect_return = On									;收集返回值
xdebug.collect_params = On									;收集参数
xdebugbug.max_nesting_level = 10000          							;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错


4:修改zend studio的默认调试器

Window -> Preferences -> PHP -> Debug 将左侧 "Default Settings" 中的 "PHP Debugger" 设置为 "XDebug"

5: 使用phpinfo测试,如果出现如下图则成功:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: