NetBeans PHP 和 XDebug - 跳转到调用堆栈上的方法?
我在使用 XDebug 通过 NetBeans 调试 PHP 项目时遇到问题,希望有人以前也遇到过这个问题。
调试对于请求的 php 文件效果很好 - 因此,如果我转到远程服务器上的 index.php,我可以在 NetBeans 中的 index.php 中的任何位置放置一个断点,代码会停在那里,我可以单步执行。
问题是,所有其他文件都像这样出现在调用堆栈上: "file:///home/user/site_html/library/class.requestprocessor.php"
并且因为这是指向文件位于远程服务器上,NetBeans 无法解析该名称,因此我无法单步执行它的代码。 它使调试几乎毫无用处! 所请求的 php 文件(例如 index.php)显示为“index.php”,只是 NetBeans 无法正确解析的所有其他文件。
NetBeans 或 XDebug 中是否有一些设置可以用来解决此问题? 我已尽力查看 NetBeans 中的所有项目设置和选项,还查看了 XDebug 扩展的所有配置选项,但无济于事。 肯定有人以前遇到过这个问题吗? 你是怎么解决的? 如果您能让我知道,我将非常感激。
如果没有其他办法,Eclipse PDT和XDebug的用户在远程服务器上调试时是否会遇到这个问题? 如果没有,我会进行切换。
I'm having trouble with debugging a PHP project through NetBeans using XDebug, and was hoping someone out there might have had this problem before.
Debugging works fine for the requested php file - so if I go to index.php on the remote server, I can put a breakpoint anywhere in index.php in NetBeans and the code stops there and I can step through.
The trouble is, all the other files appear on the call stack like this: "file:///home/user/site_html/library/class.requestprocessor.php"
and because that's a path to a file on the remote server, NetBeans is unable to resolve the name, and so I can't step through the code for it. It makes debugging practically useless! The php file that was requested, for example index.php, appears just as "index.php", it's just all the other ones which are included that NetBeans can't resolve properly.
Is there some setting in NetBeans or XDebug that I can use to solve this problem? I have tried my best looking through all the project settings and options in NetBeans, and also looked through all the configuration options of the XDebug extention, but to no avail. Surely someone out there must have had this problem before? How did you solve it? I'll be very grateful if you could let me know.
If there's no other way, do users of Eclipse PDT and XDebug have this problem when debugging on a remote server? If not I'll make the switch.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此问题似乎已在 NetBeans 6.7 中得到修复。
This issue appears to be fixed in NetBeans 6.7.
好吧,看来没有人会回答这个问题,所以我将发布我的研究结果。
由于我无法找到使 NetBeans 成功调试的方法,因此我尝试使用 Eclipse PDT 和带有 VS.php 扩展的 Visual Studio 2008 来解决我的问题。 Eclipse PDT 的设置非常困难,而且我对无法在远程服务器资源管理器中指定用于 FTP 服务器的端口的方式感到不满意。 我发现 VS.php 做了我想要的一切,它自动上传代码,并且具有完美的调试功能,而且设置起来很容易。 唯一的问题是,它看起来很丑,而且我找不到自定义颜色的方法。 然而,我将选择功能而不是时尚,因此我决定使用 VS.php 作为我的最终解决方案。 说实话,这是一种耻辱,NetBeans 真的很棒,如果没有一个可用的调试器,我就无法生活。
Okay it seems no one is going to answer the question, so I'll post the results of my research.
As I was unable to find a way to make NetBeans successfully debug as I wanted, I tried using Eclipse PDT and Visual Studio 2008 with the VS.php extension in order to solve my problem. Eclipse PDT was hell to setup, and I wasn't happy with the way you couldn't specify a port to use for your FTP server in its Remote Server Explorer. I found VS.php did everything I wanted, it automatically uploads the code, as well as having perfect debugging, and it was EASY to setup. The only thing is, it looks ugly and I can't find a way to customise its colours. However, I'm going to choose function over fashion, and so I've settled on using VS.php as my final solution. Which to be honest is a shame, NetBeans was really great, I just can't live without a working debugger.
我也有同样的问题。 我正在运行 Netbeans 6.8。 您必须右键单击您的项目,转到项目属性/运行配置/高级并设置路径映射。 将服务器上的文件夹映射到本地文件夹,以便 Netbeans 知道在遇到这些方法时要在本地打开哪些文件。
I had this same issue. I'm running Netbeans 6.8. You have to right click on your project, go to project properties/run configuration/advanced and set up path mapping. Map the folder on the server to a folder locally so that Netbeans knows which files to open locally when it hits these methods.