簡體   English   中英

在UEStudio中使用XDebug進行PHP調試

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM