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

发布于 2025-01-04 17:54:07 字数 1510 浏览 3 评论 0原文

更新2:

没关系,想通了,在netbeans中我在tools>中有一个额外的)选项>一般>网络浏览器>编辑>参数-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 配置 xdebug 以进行 php 调试。我尝试遵循几个指南,但似乎无法使其发挥作用。我已经在一台旧笔记本电脑上配置了它,但似乎不记得如何配置。目前,当我添加断点并单击“调试项目”时,它会打开一个浏览器并显示等待连接(netbeans-xdebug)。 “跳过”和“进入”选项被禁用。

我该如何解决这个问题?

到目前为止,我已经完成了以下操作:

我已经安装了 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 > 中 启用。选项> php,我做了以下事情:

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

UPDATE 2:

Nevermind, figured it out, in netbeans I had an extra ) in tools > options > general > web browser > edit > arguments was -remote {url}), so I changed it to -remote {url}.

I now have netbeans debugging php on my new laptop.

UPDATE 1:

I've been comparing my old laptop with my new laptop as debugging works on my old laptop. The only difference I have seen is the url in the browser when I click debug.

Old laptop:
http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug

New laptop:
http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug)

When I remove the ending ) from the new laptop url manually, debugging starts to work... Why does the new laptop setup have an ')' at the end and the old setup doesn't?

ORIGINAL QUESTION:

I'm trying to configure xdebug for php debugging via netbeans on a localhost. I have tried following a couple of guides, but can't seem to get it to work. I've had it configured on an old laptop, but can't seem to remember how. At the moment, when I add a breakpoint and click "debug project", it opens up a browser and displays waiting for connection (netbeans-xdebug). The "step over" and "step into" options are disabled.

How do I resolve this issue?

I have done the following so far:

I have installed lamp, php5-xdebug, and the php plugin for netbeans.

I have the following in /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

I have done service apache2 restart.

I can see that xdebug is enabled with phpinfo();

In netbeans - tools > options > php, I have done the following:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昇り龍 2025-01-11 17:54:07

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

有关详细信息,请参阅本文

Sounds like netbeans is waiting for php to callback. Did you add xdebug to php?

For more info see this article

泡沫很甜 2025-01-11 17:54:07

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

在netbeans中,我在tools>中有一个额外的)。选项>一般>网络浏览器>编辑>参数-remote {url}),所以我将其更改为-remote {url}

The solution to the problem can be seen in update 2 in the original question, which is:

In netbeans I had an extra ) in tools > options > general > web browser > edit > arguments was -remote {url}), so I changed it to -remote {url}.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文