我嘗試使用xdebug,DBGp和Notepad ++進行調試時出現問題,因爲它從未打過我的斷點。我已經做了很多的搜索,並不能看到我錯了:使用xdebug無法使記事本++命中斷點
我已經配置了正確的端口,看着我的xdebug.log時,我可以看到,它似乎很高興:
Log opened at 2013-04-22 12:10:58
I: Connecting to configured address/port: 127.0.0.1:8080.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/Program%20Files%20%28x86%29/resources/appliance/download_agents.php" language="PHP" protocol_version="1.0" appid="2740" idekey="xdebug"><engine version="2.2.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2013-04-22 12:10:58
Log opened at 2013-04-22 12:11:19
I: Connecting to configured address/port: 127.0.0.1:8080.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/Program%20Files%20%28x86%29/resources/appliance/download_agents.php" language="PHP" protocol_version="1.0" appid="2740" idekey="xdebug"><engine version="2.2.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2013-04-22 12:11:19
然而,它似乎從來沒有達到斷點。
我已在文件download_agents.php DBG斷點,我輸入網址:
http://localhost:8080/download_agents.php?XDEBUG_SESSION_START=xdebug
但它從來沒有擊中它。刷新導致一個新條目被添加到上述日誌文件,所以似乎連接。但Notepad ++中DBG的GUI沒有連接消息。
我的php.ini文件分錄如下:
[xdebug]
zend_extension="C:\nginx\php\ext\php_xdebug-2.2.2-5.3-vc9.dll"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=8080
xdebug.remote_mode=req
xdebug.idekey=default
xdebug.remote_log="c:\tmp\xdebug\xdebug.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.profiler_enable = 1
xdebug.profiler_output_dir ="c:\tmp\xdebug"
和DBG配置如下所示:
在遠程路徑和本地路徑指向根我的web應用程序並匹配xdebug.log文件中的輸出:
file:/// C:/ Program%20Files%20%28x86%29/resources/appliance/downlo ad_agents.php」
請任何援助將大大收到..
感謝
你試過定義一個ide-key嗎?即'xdebug.idekey = myIDE0815'和'IDE KEY => myIDE0815' – Sammy 2013-04-22 12:25:29
嗨,謝謝你的回覆。我已經添加了一個IDE密鑰,但這可以是任何你喜歡的東西嗎?無論如何不會有所作爲。 – Yos 2013-04-22 12:38:44
可能值得一提的是,我將remote_port從9000更改爲8080,因爲這是我的PHP正在監聽的端口... – Yos 2013-04-22 12:46:48