简体   繁体   English

在Debian OS上使用NetBeans和XDebug调试Symfony2项目

[英]Debug a Symfony2 project with NetBeans and XDebug on Debian OS

I usually use PhpStorm and the xdebug setup is easy and straightforward. 我通常使用PhpStorm,xdebug设置简单明了。 But now I have to setup NetBeans to work with xdebug. 但现在我必须设置NetBeans才能使用xdebug。 I have the following configuration in the php.ini file: 我在php.ini文件中有以下配置:

[XDebug]

zend_extension=/usr/lib/php5/20131226/xdebug.so

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug

I also tried to put the configuration in the xdebug.ini file. 我还尝试将配置放在xdebug.ini文件中。 But this does not changed anything. 但这并没有改变任何事情。 How I have configured the netbeans IDE: 我如何配置netbeans IDE:

  • I have checked the Stop at First Line and Show Debugger Console from Tools > Options > PHP > Debugging 我已经从工具>选项> PHP>调试中检查了第一行停止显示调试器控制台
  • I also right clicked on the project and opened the Propertes. 我也右键点击了该项目并打开了属性。
  • I have set the web folder of the symfony project for a Web Root on the project in the Sources tab. 我在Sources选项卡中为项目的Web Root设置了symfony项目的web文件夹。
  • I have setup the app_dev.php file as an index file in the Run Configuration . 我已将app_dev.php文件设置为运行配置中的索引文件。

I have put a breakpoint and started the debugger but It just doesn't want to stop. 我已经放了一个断点并启动了调试器,但它只是不想停止。 I believe my xdebug configuration is correct since I don't have any problems with the debugging in PhpStorm. 我相信我的xdebug配置是正确的,因为我在PhpStorm中的调试没有任何问题。 Any suggestions on what I have missed? 对我错过的任何建议?

Thanks in advance! 提前致谢!

This configuration actually worked. 这种配置实际上有效。 I just had to restart NetBeans IDE. 我只需要重新启动NetBeans IDE。 It bugs a little from time to time and needs a reboot to start working again. 它有时会出现一些问题,需要重新启动才能重新开始工作。

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

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