尽管经历了所有论坛回答,netbeans xdebug仍在等待连接 [英] netbeans xdebug waiting for connection despite going through all forum answers

查看:163
本文介绍了尽管经历了所有论坛回答,netbeans xdebug仍在等待连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用netbeans调试器时,出现消息等待连接(netbeans-xdebug)".

I get the message "waiting for connection (netbeans-xdebug)" when using netbeans debugger.

我正在使用: Windows 10 适用于Windows 5.6.20的XAMPP XAMPP控制面板v3.2.2 NetBeans IDE 8.0.2

I am using: Windows 10 XAMPP for Windows 5.6.20 XAMPP control panel v3.2.2 NetBeans IDE 8.0.2

我每天都在围绕论坛的答案进行各种尝试,但都无所作为.

I have been round and round the forum answers for days trying everything but have drawn a blank.

php.ini中的代码是:

The code in php.ini is :

> [XDebug]
; Only Zend OR (!) XDebug
zend_extension = c:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll
xdebug.remote_autostart=on
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_handler="dbgp"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="c:\xampp\tmp"
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

我已经尝试了以上所有可以想象的参数组合.

I have tried every combination of parameters for the above imaginable.

我在netbeans中使用的端口是: 项目属性>运行配置>高级:9001 Netbeans>工具>选项> PHP>调试:9001

The port I have used in netbeans is: project properties > Run Configuration > Advanced: 9001 Netbeans > Tools > Options > PHP > Debugging : 9001

调试器使用的是Chrome浏览器是否很重要,但是我的phpmyAdmin和XAMPP的主屏幕都位于IE上?

Could it be significant that the debugger is using the Chrome browser, but my phpmyAdmin and the home screen for XAMPP are on IE?

推荐答案

我不确定Windows,但是在Linux上更高版本的PHP(至少从5.4开始)中,xdebug配置位于单独的文件中.我的在:

I'm not sure about Windows, but in later versions of PHP on linux (starting from at least 5.4) the xdebug configuration is in a separate file. Mine is in:

/etc/php/7.0/apache2/conf.d/20-xdebug.ini

如果您没有专用的xdebug ini文件,请确保您在编辑正确的php.ini.在我的系统中,有3:

If you don't have a dedicated xdebug ini file, make sure you are editing the right php.ini. In my system there are 3:

/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.0/phpdbg/php.ini

这是我的xdebug配置:

Here is my xdebug configuration:

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.show_local_vars=on

一些注意事项:

  1. 我看到您的港口与我的港口不同(9000与9001).转到工具"->选项"->"PHP",在调试"选项卡上,确保调试器端口"对应于xdebug.remote_port中指定的端口.

  1. I see your port is different from mine (9000 vs 9001). Go to Tools->Options->PHP, at the "Debugging" tab make sure the "Debugger port" corresponds to the one specified in xdebug.remote_port.

尝试使用localhost而不是127.0.0.1

Try to use localhost instead of 127.0.0.1

确保phpinfo()的输出包含有关xdebug的信息.如果没有"xdebug"部分,则可能需要检查zend_extension路径.

Make sure the output of phpinfo() contains information about xdebug. If you don't have an "xdebug" section you probably need to check the zend_extension path.

我记得在NetBeans邮件列表上读到,有些人是Windows防火墙引起的问题,也许您可​​以尝试将其禁用.

I remember reading on the NetBeans mailing list that a few people had problems caused by the Windows firewall, maybe you can try to disable it.

这篇关于尽管经历了所有论坛回答,netbeans xdebug仍在等待连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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