在本地Web服务器(xampp)和PHP7上安装Xdebug?

在本地Web服务器(xampp)和PHP7上安装Xdebug?,php,netbeans,xampp,xdebug,netbeans-8,Php,Netbeans,Xampp,Xdebug,Netbeans 8,我尝试了好几个小时才开始,但都没有成功 首先,我通过访问这个网站来确定我需要哪个php_xdebug.dll版本,并按照他们的说明进行操作 Summary Xdebug installed: 2.6.0 Server API: Apache 2.0 Handler Windows: yes - Compiler: MS VC15 - Architecture: x86 Zend Server: no PHP Version: 7.2.3 Zend API nr: 320170718 PHP AP

我尝试了好几个小时才开始,但都没有成功

首先,我通过访问这个网站来确定我需要哪个php_xdebug.dll版本,并按照他们的说明进行操作

Summary
Xdebug installed: 2.6.0
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC15 - Architecture: x86
Zend Server: no
PHP Version: 7.2.3
Zend API nr: 320170718
PHP API nr: 20170718
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: A:\xampp\php\php.ini
Extensions directory: A:\xampp\php\ext
You're already running the latest Xdebug version
But here are the instructions anyway:

1. Download php_xdebug-2.6.0-7.2-vc15.dll
2. Move the downloaded file to A:\xampp\php\ext
3. Update A:\xampp\php\php.ini and change the line
   zend_extension = A:\xampp\php\ext\php_xdebug-2.6.0-7.2-vc15.dll
4. Restart the webserver
这是我的
php.ini
代码片段:

[XDebug]
zend_extension="A:\xampp\php\ext\php_xdebug-2.6.0-7.2-vc15.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.remote_enable = on
xdebug.remote_handler = "dbgp"
xdebug.remote_host = localhost
xdebug.remote_port = 9001
xdebug.trace_output_dir = "A:\xampp\tmp"
xdebug.remote_log = "A:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_autostart = on
xdebug.remote_connect_back = on
我在netbeans中相应地设置了
端口
idekey
(工具->选项->PHP->调试)

…我还确保项目正在使用设置(项目->属性->运行配置)

我重新启动了NetBeans和Apache。 我甚至安装了扩展名“Xdebug助手”和“NetBeans连接器”。 Xdebug帮助程序扩展已配置并设置为调试模式


现在我设置了一个断点。但在右键单击源代码并单击“调试文件”之后,我得到了“等待连接(netbeansxdebug)”,它将永远加载

我也无法单击调试按钮,它们都是灰色的:

我总是使用以下参数调用目标站点,如:
?XDEBUG\u SESSION\u START=netbeansxdebug


因此,我尝试了不同于其他问题的解决方案,但毫无帮助

我已经尝试将php.ini中的行
xdebug.remote\u host
更改为我的本地ipv4地址,但没有任何区别。我还测试了不同的端口。当然,我总是在修改php.ini中的某些内容后重新启动apache

我使用的是Windows10Pro 64位和Chrome

有什么想法吗?提前感谢您的帮助


更多:


我检查了我的防火墙,端口没有被阻止。

多亏@LazyOne的提示,我才得以解决。检查日志后,我发现netbeans试图连接到随机ip地址:

Log opened at 2018-04-10 21:14:12
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Remote address found, connecting to 74.84.178.15:9001.
E: Time-out connecting to client (Waited: 200 ms). :-(
Log closed at 2018-04-10 21:14:12

Log opened at 2018-04-10 21:17:27
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Remote address found, connecting to 212.112.65.234:9001.
E: Time-out connecting to client (Waited: 200 ms). :-(
Log closed at 2018-04-10 21:17:27

Log opened at 2018-04-10 21:19:22
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Remote address found, connecting to 57.101.242.52:9001.
E: Time-out connecting to client (Waited: 200 ms). :-(
Log closed at 2018-04-10 21:19:22

我立刻意识到这与chrome扩展名ipflood有关,它随机更改ip地址。它在禁用后工作

xdebug日志对此有何评论?“我已经尝试更改xdebug.remote\u host行了”这不会有什么区别,因为您已经启用了
xdebug.remote\u connect\u back=on
(在大多数情况下,它会忽略remote\u host)@LazyOne,在更改
xdebug.remote\u connect\u host
后,我评论说
xdebug.remote\u connect\u back=on
。日志显示它试图连接到随机ip地址!!这是因为chrome的扩展名“ipflood”(ipfuck)。禁用扩展后,它可以工作!!:)