简体   繁体   English

使用NetBeans / XDebug调试Zend Framework项目

[英]Debugging Zend Framework project with NetBeans / XDebug

Has anyone been able to set up NetBeans debugging of a Zend Framework project? 有人能够设置Zend Framework项目的NetBeans调试吗? I have XAMPP running locally on my machine, as well as NetBeans 6.8. 我的计算机以及NetBeans 6.8都在本地运行XAMPP。 From the looks of phpinfo(), XDebug is properly installed on XAMPP. 从phpinfo()的外观来看,XDebug已正确安装在XAMPP上。 I start debugging session with NetBeans, it connects to XDebug and the page opens, however it will not stop at any break point. 我开始使用NetBeans调试会话,它连接到XDebug并打开页面,但是它不会在任何断点处停止。

This is an excerpt from the NetBeans log if you're interested: 如果您有兴趣,请摘录自NetBeans日志:

<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug"      command="step_into" transaction_id="165" status="stopping" reason="ok"></response>
FINE [org.netbeans.modules.php.dbgp.ServerThread]
java.net.SocketTimeoutException: Accept timed out
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(Unknown Source)
        at java.net.ServerSocket.implAccept(Unknown Source)
        at java.net.ServerSocket.accept(Unknown Source)
        at org.netbeans.modules.php.dbgp.ServerThread.run(ServerThread.java:47)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[catch] at java.lang.Thread.run(Unknown Source)

This timeout looks suspicious, but I'm not sure if it's causing the problem. 这个超时看起来很可疑,但是我不确定是否是引起问题的原因。

This is an excerpt from my php.ini configuration: 这是我的php.ini配置的摘录:

extension=php_xdebug-2.0.5-5.3-vc6.dll
xdebug.extended_info = 1
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000

Do you have any suggestions? 你有什么建议吗?

I've solved it. 我已经解决了 The problem is that XDebug had to be enabled through Zend Extension Manager (not through regular PHP extensions), and there was no Zend Extension Manager in XAMPP 1.7.2 (which I had). 问题在于必须通过Zend Extension Manager(而不是通过常规的PHP扩展)启用XDebug,并且XAMPP 1.7.2(我拥有的)中没有Zend Extension Manager。 I downgraded to XAMPP 1.7.0 and it worked. 我降级到XAMPP 1.7.0,它起作用了。 I also had to disable Zend Optimizer and download a newer version of XDebug. 我还必须禁用Zend Optimizer并下载XDebug的较新版本。 This is my final PHP configuration: 这是我的最终PHP配置:

[Zend]
zend_extension_ts = "\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "\xampp\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 1
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path =
; Local Variables:
; tab-width: 4
; End:

[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts="\xampp\php\ext\php_xdebug-2.0.5-5.2.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="\xampp\tmp"
xdebug.idekey = "netbeans-xdebug"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM