使用 Eclipse 调试 PHP 脚本

发布于 2024-08-06 12:34:57 字数 2025 浏览 13 评论 0原文

我已经使用 Eclipse 3.4.2 与 PHPEclipse 和 Zend Debugger 一段时间了,没有出现任何问题。突然,我无法调试 PHP 脚本。我可以很好地运行它们,但是当我选择调试为...时,脚本会在“调试”窗口中显示,就像它正在运行一样,但事实并非如此。如果我单击“暂停”,它会报告位于第 0 行。我可以单步执行它,如果我恢复,让它静置,然后再次暂停它,它仍然报告位于第 0 行。

我尝试关闭所有内容,重新启动我的系统,并创建一个新项目,但运气不佳。

我最近更新了Ubuntu系统,但是没有任何与PHP或Eclipse相关的内容(据我所知)。 XULRunner 已更新。

我检查了调试配置,它选择了 Zend 调试器和 PHP 可执行文件,就像以前工作时一样。我尝试过编辑源查找以确保它在正确的位置。

有什么想法吗?

编辑: Eclipse 的调试器正在侦听端口 10000,我可以 telnet localhost 10000 正常。当我发送一些垃圾字符时,Eclipse 会弹出一条有关调试器不兼容的错误消息,因此它似乎正在监听

编辑:我无法弄清楚到底发生了什么,但创建一个新的工作区似乎可以解决问题

更新:我尝试过eclipse -clean (我在 ubuntu 上)但这对我没有帮助。我找到了 .log 文件并注意到以下错误。启动时:

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.979
!MESSAGE NLS missing message: DebugConnectionThread_oldDebuggerVersion in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.980
!MESSAGE NLS missing message: DebugServerTestEvent_success in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.980
!MESSAGE NLS missing message: DebugServerTestEvent_timeOutMessage in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

在我尝试启动调试会话后:

!ENTRY org.eclipse.php.debug.core 4 10001 2009-10-05 17:02:23.455
!MESSAGE Can't determine version of the PHP executable

!ENTRY org.eclipse.php.debug.core 4 10001 2009-10-05 17:02:23.983
!MESSAGE PHPDebug plugin internal error
!STACK 0
java.lang.NullPointerException
    at org.eclipse.php.internal.debug.core.preferences.stepFilters.DebugStepFilterController.isFiltered(DebugStepFilterController.java:98)
    at org.eclipse.php.internal.debug.core.zend.debugger.handlers.ReadyNotificationHandler.handle(ReadyNotificationHandler.java:34)
    at org.eclipse.php.internal.debug.core.zend.communication.DebugConnectionThread$InputMessageHandler.run(DebugConnectionThread.java:881)
    at java.lang.Thread.run(Thread.java:636)

我试图看看是否可以追踪到其他任何内容。

I've been using Eclipse 3.4.2 with PHPEclipse and Zend Debugger for some time without issue. Suddenly, I cannot debug the PHP scripts. I can run them fine but when I select Debug As... the script shows in the Debug window as if it were running, but it is not. If I click pause it reports as being on line 0. I can step through it, if I resume, let it sit and then pause it again it still reports being on line 0.

I've tried closing everything all down, restarting my system, and creating a new project without luck.

I had recently updated the Ubuntu system, but there was nothing related to PHP or Eclipse (that I could tell). XULRunner was updated.

I've checked the Debug Configs, it has the Zend Debugger and the PHP Executable selected as they had been before when working. I've played around with Editing the Source Lookup to make sure it's looking at the right place.

Any ideas?

Edit: eclipse's debugger is listening on port 10000 i can telnet localhost 10000 fine. when i send some garbage characters eclipse pops up an error message about incompatible debugger so it seems to be listening

Edit: I wasn't able to figure out what was really going on but creating a new workspace seemed to do the trick

Update: I tried eclipse -clean (i'm on ubuntu) but that didn't help me. I found the .log file and noticed the following errors. On Startup:

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.979
!MESSAGE NLS missing message: DebugConnectionThread_oldDebuggerVersion in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.980
!MESSAGE NLS missing message: DebugServerTestEvent_success in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

!ENTRY org.eclipse.osgi 2 1 2009-10-05 17:02:11.980
!MESSAGE NLS missing message: DebugServerTestEvent_timeOutMessage in: org.eclipse.php.internal.debug.core.PHPDebugCoreMessages

After I try to start a debug session:

!ENTRY org.eclipse.php.debug.core 4 10001 2009-10-05 17:02:23.455
!MESSAGE Can't determine version of the PHP executable

!ENTRY org.eclipse.php.debug.core 4 10001 2009-10-05 17:02:23.983
!MESSAGE PHPDebug plugin internal error
!STACK 0
java.lang.NullPointerException
    at org.eclipse.php.internal.debug.core.preferences.stepFilters.DebugStepFilterController.isFiltered(DebugStepFilterController.java:98)
    at org.eclipse.php.internal.debug.core.zend.debugger.handlers.ReadyNotificationHandler.handle(ReadyNotificationHandler.java:34)
    at org.eclipse.php.internal.debug.core.zend.communication.DebugConnectionThread$InputMessageHandler.run(DebugConnectionThread.java:881)
    at java.lang.Thread.run(Thread.java:636)

I'm trying to see if I can track down anything else given this.

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

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

发布评论

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

评论(3

庆幸我还是我 2024-08-13 12:34:57

您提到您无法弄清楚发生了什么,但创建一个新的工作区似乎可以解决问题。该案例可能只是 Eclipse 的一个众所周知的问题。基本上,随着时间的推移,系统中的缺陷往往会逐渐增多。当这种情况发生时,Eclipse(尤其是插件)开始崩溃。您可以在启动 Eclipse 时使用 -clean 参数来解决此问题(无需创建新工作区)。

因此,如果您运行的是 Windows,请编辑指向 Eclipse 的快捷方式,以便您看到:

eclipse.exe -clean

这应该会有所帮助。在此处阅读有关它的更多信息:保持 Eclipse 干净运行

You mentioned that you couldn't figure out what was going on, but creating a new workspace seemed to solve the problem. The case is probably just a well-known issue with Eclipse. Basically, over time, cruft tends to build up in the system. As this happens, Eclipse (and particularly the plugins) start to break. You can solve this (without creating a new workspace) by using the -clean argument when starting Eclipse.

So, if you are running Windows, edit the shortcut pointing to Eclipse so that you see:

eclipse.exe -clean

That should help. Read more information about it here: Keeping Eclipse Running Clean

断肠人 2024-08-13 12:34:57

eclipse 真正好的一点是它没有安装程序,尽管我在某条道路上看到一些好心的旅行者使您可以apt-get eclipse。 (提示:不要这样做。)

不太好的事情之一是它相当复杂。如果您认为您可能已经翻转了它拥有的数千个开关之一,只需解压存档并进行并行安装即可。即使在 Windows 上,Eclipse 也能表现良好。如果并行安装有效,那么至少您知道这只是您的工作区或配置,如果没有,您知道要从外部查看。 (呃,除非你在运行配置中犯了两次同样的错误。)

One of the really nice things about eclipse is that it has no installer, although I see some well-intentioned traveller on a certain road has made it possible for you to do apt-get eclipse. (Hint: don't do that.)

One of the not-so-nice things is that it is rather complex. If you think you may have flipped one of the thousands of switches it has, just unpack the archive and do a parallel install. Eclipse is well-behaved that way, even on windows. If the parallel install works, then at least you know it's just your workspace or configuration, and if it doesn't, you know to look externally. (Err, unless you made the same mistake twice with your run config.)

帅的被狗咬 2024-08-13 12:34:57

您的防火墙是否进行过任何更改?我使用 NuSphere 的 php 调试器,它通过 TCP 套接字进行通信。如果您的防火墙在更新期间被修改,您的防火墙可能会阻止调试器服务器通过其(可能)运行的本地主机端口联系您的调试器客户端。不太清楚 Eclipse 的调试器是如何工作的,但我猜也是这样。

为了好玩,您可以尝试运行 snort 来查看调试器是否正在向您发送数据包。

Were any changes made to your firewall? I use NuSphere's php debugger, and it communicates via a TCP socket. If your firewall was modified during the update, your firewall could be preventing the debugger server from contacting your debugger client via the localhost port it (maybe) runs on. Not too sure how Eclipse's debugger works, but I would guess the same way.

For kicks, you can try running snort to see if the debugger is sending packets to you.

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