现在的位置: 首页 > 综合 > 正文

Win7+zend studio 9.0.3 +WampServer2.2 +php_xdebug-2.2.0-5.3-vc9 debug配置 有图有真相

2012年05月03日 ⁄ 综合 ⁄ 共 1748字 ⁄ 字号 评论关闭

折腾了一下午zend studio 9.0.3 +WampServer2.2+ZendDebuger的debug配置,

官方文档 baidu google 全用上了 反复折腾,也没搞定zend debuger,估计是 5_3_x_nts_comp的ZendDebugger 不支持WampServer2.2自带的php5.3.13.

希望成功搞定的朋友 指教下!

最后决定使用WampServer2.2自带的xdebug 调试PHP代码。

配置步骤如下:

一、wamp端 xdebug 配置

1.找到wamp的apache安装目录

我的安装目:

C:\wamp\bin\apache\apache2.2.22\bin\

2.打开php.in文件,找到“; XDEBUG Extension”所在位置

原样如下:

; XDEBUG Extension

zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"

[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"

修改XDEBUG后的信息如下:

; XDEBUG Extension

zend_extension = "c:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9.dll"

[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"

简单说明如下:

允许远程调试:xdebug.remote_enable = on

默认调试协议:xdebug.remote_handler=dbgp

远程服务器IP地址(localhost指的是本机):xdebug.remote_host=localhost

默认端口:xdebug.remote_port=9000

至此,wamp端 xdebug 配置完成。

二、zendstudio端xdebug 配置

1.打开zendstudio9.0.3,依次选择 windows->preferences->PHP->PHP Executables Add 新的PHP Executables

如下图所示:

配置debug如下图所示:PS:http://localhost:8080 是我本地的apache server 运行地址,你可以改成你自己的server地址。

至此,zendstudio端,xdebug的配置也完成了。

三、测试配置成果

在zendstudio中新建php 项目,建议content选择basic类型的,之后一路next就行了。

步骤如下图所示:

 

打开创建好的index.php,加入如下测试代码,保存文件。

<?php
echo "Hello World";

echo "This spans multiple lines. The newlines will be output as well";

echo "This spans\nmultiple lines. The newlines will be\noutput as well.";

echo "Escaping characters is done \"Like this\".";

?>

下面开始调试:

第一步,右键单击你刚刚创建好的工程,选择debug as,如下图所示:

出现如下图所示的效果,说明你的xdebug 配置成功。

 

想到哪里写到哪里,有什么看不懂的地方欢迎来电来函.呵呵

 

 

抱歉!评论已关闭.