使用netbeans配置php调试时遇到困难


Having difficulty configuring php debugging using netbeans

更新2:

无论如何,我发现在netbeans中,tools > options > general > web browser > edit > arguments中有一个额外的)-remote {url}),所以我把它改成了-remote {url}

我现在有netbeans在我的新笔记本电脑上调试php。

更新1:

我一直在比较我的旧笔记本电脑和我的新笔记本电脑,因为调试工作在我的旧电脑上进行。我看到的唯一区别是当我单击调试时浏览器中的url。

旧笔记本电脑:http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug

新笔记本电脑:http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug)

当我手动从新的笔记本电脑url中删除结尾的)时,调试就开始了。。。为什么新的笔记本电脑设置在末尾有一个")",而旧的设置没有?

原始问题:

我正在尝试通过本地主机上的netbeans为php调试配置xdebug。我试着遵循了几条指南,但似乎无法奏效。我在一台旧笔记本电脑上配置过,但似乎不记得是怎么配置的。目前,当我添加一个断点并单击"调试项目"时,它会打开一个浏览器并显示waiting for connection (netbeans-xdebug)。"逐步过渡"answers"逐步进入"选项被禁用。

如何解决此问题?

到目前为止,我已经做了以下工作:

我已经安装了lamp、php5-xdebug和用于netbeans的php插件。

我在/etc/php5/apache2/conf.d/xdebug.ini中有以下内容:

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_enable=1

我做了service apache2 restart

我可以看到xdebug是用phpinfo(); 启用的

在netbeans-tools>options>php中,我完成了以下操作:

PHP 5 Interpreter = /usr/bin/php
Bebugger Port = 9000
Session ID = netbeans-xdebug

听起来像是netbeans在等待php回调。你把xdebug添加到php了吗?

有关更多信息,请参阅本文

问题的解决方案可以在原始问题的更新2中看到,即:

在netbeans中,我在tools > options > general > web browser > edit > arguments中有一个额外的)-remote {url}),所以我将其更改为-remote {url}