【发布时间】:2023-03-03 16:08:02
【问题描述】:
我正在使用 Windows 8、Netbeans 8.2、php 5.6、Apache 和 mysql。我手动安装了它们,没有使用 WAMP 之类的一体化软件包。
当我单击调试图标 (Ctrl+F5) 时,它会卡在“等待连接 (netbeans-xdebug)”上,同时完全显示页面而不会在断点处停止。
我查看了所有可能的解决方案,但没有一个对我有用。如:
- 将 remote_host 从“localhost”更改为 127.0.0.1 甚至更改为我机器的 IP 地址
- 将端口从 9000 更改为不同的端口。还要检查“Session-ID = netbeans-xdebug”
- 在 Netbeans 上设置默认的“Web 浏览器”
- 检查https://xdebug.org/wizard.php并按照说明进行操作
- 在 php.ini 中设置 date.zone
- 检查防火墙(据我所知,我的防火墙没有阻止连接)
- 重新启动 httpd.exe (Apache) 和 netbeans 和浏览器
以下是从我的系统中获得的一些信息:
来自https://xdebug.org/wizard.php:
量身定制的安装说明
总结
Xdebug 已安装:2.5.0rc1
服务器 API:Apache 2.0 处理程序
Windows:是 - 编译器:MS VC11 - 架构:x64
Zend 服务器:没有
PHP 版本:5.6.27
Zend API 编号:220131226
PHP API 编号:20131226
?Debug Build:否
线程安全构建:是
配置文件路径:C:\Windows
配置文件:C:\php\php.ini
扩展目录:ext
您已经在运行最新的 Xdebug 版本
来自 php -m 命令:
[PHP 模块]
bcmath
日历
.
.
. (我故意删掉了)
[Zend 模块]
Xdebug
来自 netstat | findstr 9000
TCP 127.0.0.1:9000 mycomputername:62936 CLOSE_WAIT
TCP 127.0.0.1:62936 mycomputername:9000 FIN_WAIT_2
TCP [::1]:9000 mycomputername:62935 CLOSE_WAIT
TCP [::1}:62935 mycomputername::9000 FIN_WAIT_2
最后但并非最不重要的是,在 php.ini 中没有 [Xdebug] 部分!!有一些行,但作为一个单独的部分,就像有些人说的那样没有什么所以在文件末尾我添加了这些行:
[xdebug]
zend_extension = php_xdebug-2.5.0rc1-5.6-vc11-x86_64.dll
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_enable = 开启
xdebug.remote_host = "本地主机"
xdebug.remote_port = 9000
感谢任何建议。
【问题讨论】:
标签: php windows apache netbeans xdebug