[英]Using XDebug in UEStudio for PHP debugging
我刚刚下载了UEStudio 09的最新版本,并正在尝试集成的XDebug功能。
我已经安装了xdebug,并通过php_info()进行了验证。 我编写了一个非常基本的脚本来对其进行测试:
1: <?php
2: $x = 5;
3: $y = $x + 1;
4: $z = 10;
5: while ($z--) {
6: echo $x, $y, "<br />\n";
7: }
然后,我开始了调试会话,并在我的输出窗口中得到了以下消息:
Client: Listening for connection...
我在第4行添加了一个断点,只是为了对其进行测试。 然后,使用特殊的url参数在浏览器中打开文件:
http://localhost/uetest/index.php?XDEBUG_SESSION_START=test
该脚本可以正常运行,并且不会因调试或其他任何操作而停止。 输出是这样的:
Client: Listening for connection... Client: Connection accepted Client: Initializing session ============================== Debug Engine Name: Xdebug Debug Engine Version: 2.0.3 Protocol Version: 1.0 ============================== Client: Session active Client Command: Step Into Client: Exiting debug session Script completed without errors
如果我访问http://localhost:9000/uetest/index.php
则UEStudio会说“已接受连接”,但此后什么也没发生! 该脚本永远不会在浏览器中完成,然后最终UEStudio崩溃。
有任何想法吗?
上周,我评估了UEStudio替代Zend Studio 5.5。 我按如下所示设置了XDebug配置并使其正常工作:
[XDebug]
zend_extension_ts=./ext/php_xdebug.dll
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=d:/
xdebug.profiler_output_name=timestamp
xdebug.remote_enable=1
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.remote_port=9000
xdebug.remote_host=localhost
xdebug.idekey=debug
我必须在php.ini中添加一些设置才能使其正常运行。 以上是结果配置。 另外,我安装了XDebug Helper Firefox插件,以直接从Firefox开始调试。 很方便。
很多年前,我使用xdebug,但是最近我一直在使用Zend Debugger,因此我不记得要立即使用什么工具才能使xdebug.dll正常工作。 我确实记得,但是,我确实需要在php.ini中添加一些条目。 我为Zend Debugger提供的条目是:
对于Linux:
[Zend]
zend_extension=/usr/lib/php5/20060613+lfs/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
对于Windows:
[Zend]
zend_extension_ts="c:/php/ext/ZendDebugger.dll"
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
Google搜索“ php xdebug php.ini”将我带到了这里:
http://devzone.zend.com/article/2930-Debugging-PHP-applications-with-xdebug
这表明:
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
用于xdebug。
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.