Xdebug 和 Netbeans 问题 [英] Xdebug And Netbeans Problem

查看:28
本文介绍了Xdebug 和 Netbeans 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置 xdebug 以使用 Netbeans 6.9 和 php 5.3
就我而言,我已经正确设置了 xdebug.
我可以从 phpinfo 页面看到 xdebug 扩展.
我已经阅读了其他帖子并尝试了他们的建议,但无济于事

Im trying to configure xdebug to work with Netbeans 6.9 and php 5.3
As far as i concern i have setup xdebug properly.
I can see xdebug extension from phpinfo page.
I have read other post and tried their suggestion but up to no avail

当我点击调试按钮时,它直接在浏览器中打开页面,我可以在 netbeans 的底部窗格中看到消息等待连接"

When i hit the debug button, it straight open the page in the browser and i can see message 'Waiting for connection' in the bottom pane of netbeans

这里是我在 php.ini 中的设置

Here my setting in php.ini

zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"

任何帮助将不胜感激

推荐答案

首先,检查它是否真的不适合您,并且您没有注意到.我已经这样做了......确信它不起作用我浪费了大量时间试图让它工作,结果发现一切正常.

First, check that it isn't actually working for you, and you don't notice. I've done this...convinced it's not working I wasted a chunk of time trying to get it to work, only to find that everything was OK.

查看您的 NetBeans 状态栏.如果您看到netbeans-xdebug"和正在运行",那么它实际上工作得很好.您可能关闭了在第一行停止"选项,并且您还没有遇到您设置的任何断点(如果有).这就是您看到的页面几乎没有或没有迹象表明调试器实际上已连接的原因.

Look at your NetBeans status bar. If you see "netbeans-xdebug" and "running" then it is actually working just fine. You probably have the "Stop at first line" option turned off and you didn't hit any breakpoints you set (if any) yet. That would be a reason you are seeing the page with little or no indication that the debugger is actually connected.

如果您看到的是Waiting for Connection (netbeans-xdebug)"并且进度条在循环,那么您确实没有连接.打开工具|选项,然后转到 PHP 页面.在常规选项卡上,确保调试器端口"为 9000,会话 ID"为netbeans-xdebug".您可能希望选中停在第一行".我没有,因为我觉得这有点烦人.我肯定会确保不检查手表和气球评估".此选项会导致 NetBeans 和调试器不稳定.如果您需要手表,请在需要它的 PHP 代码中加入一个局部变量,当调试器运行时,您将在变量"选项卡上看到它.另外,确认在项目的运行配置 > 索引文件中指定了文件 (index.php).

If you instead see "Waiting for Connection (netbeans-xdebug)" and the progress bar is cycling, then you are indeed not connected. Open Tools|Options, and go to the PHP page. On the general tab, make sure that the "Debugger port" is 9000 and the "Session ID" is "netbeans-xdebug". You may want to have "Stop at First Line" checked. I don't, as I find it a bit annoying. I would definitely ensure that "Watches and Balloon Evaluation" is not checked. This option causes NetBeans and the debugger to destabilize. If you need a watch, hack a local variable into the PHP code where you need it, and you'll see it on the "Variables" tab when the debugger is running. Also, confirm that file (index.php) is specified in the project's Run Configuration > Index File.

既然您在 phpinfo() 中看到了 xdebug,那么就可以了.只需确保所有值看起来都合理,并且在该页面的某处有一些对 cookieXDEBUG_SESSION=netbeans-xdebug"的引用.(确保您没有在浏览器上关闭 cookie!)

Since you see xdebug in phpinfo(), that end of it is fine. Just make sure that all of the values look reasonable, and that there is some reference to a cookie "XDEBUG_SESSION=netbeans-xdebug" somewhere on that page. (Make sure that you don't have cookies turned off on the browser!)

唯一要检查的另一件事是查看是否正在运行某些会在本地阻止 TCP/UDP 的防火墙/安全程序(这很奇怪,但并非不可能),或者端口 9000尚未被其他应用程序使用.由于某种原因,我在本地设置中使用了不同的端口号.我不记得改变它,但我确信我唯一的原因是如果我遇到了与其他东西的端口冲突.

The only other thing to check is to see if some firewall/security program is running that would be blocking TCP/UDP locally (which would be super-odd, but not out of the realm of possibility), or that port 9000 isn't already used by another application. I am using a different port number in my local setup for some reason. I don't remember changing it, but I am sure that the only reason I would have is if I had hit a port conflict with something else.

最后一件事...我们一直假设您在同一台计算机上运行 NetBeans 和 Web 服务器.这是一种常见的配置,但不是唯一的配置.如果您的 Web 服务器在另一台计算机上,请将 xdebug.remote_host=localhost 中的 localhost 更改为运行 NetBeans 的计算机的 IP 地址.

One last thing... We've been assuming that you are running NetBeans and the web server on the same computer. That's a common configuration, but not the only one. If your web server is on a different computer, then change the localhost in xdebug.remote_host=localhost to the IP address of the computer on which NetBeans is running.

最后一件事:当循环通过令人沮丧的迭代时,直到您在 phpinfo() 中看到 xdebug 信息,重新启动 apache/php.到达那里后,仍然在迭代之间重新启动 NetBeans.信不信由你,重启浏览器.

Another last thing: When cycling through frustrating iterations, until you see xdebug info in phpinfo(), restart apache/php. Once there, still restart NetBeans between iterations. And believe it or not, restart your browser.

这篇关于Xdebug 和 Netbeans 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆