我正在尝试在以下场景中使用 XDebug
I'm trying to use XDebug in the following scenario
我从我的 Windows 主机创建了一个 Netbeans 项目,指向 \guestIPmysite.在项目运行配置中,我有以下内容:
I created a Netbeans project from my Windows Host, pointing to \guestIPmysite. In the project Run configuration, I have the following:
在高级运行配置中:
我的 Ubuntu VM 上的 php.ini 中有以下内容
I have the following in the php.ini on my Ubuntu VM
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = /tmp
;xdebug.remote_host=localhost,<HostIP>, mysite.local.fr
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.idekey="netbeans-xdebug"
xdebug.remote_mode=req
这些都不起作用,Netbeans 不会在 Windows 的任何断点处停止.
None of this works, Netbeans does not stop at any breakpoint from Windows.
使用 Netbeans 直接从我的 VM 调试工作正常.
谁能告诉我如何让我的调试器从 Windows 远程工作?谢谢
Can someone tell me how to get my debugger to work remotely from Windows? Thanks
抱歉,我不能再发表评论了.@David @JamesB41:我也在找这个.我的设置是带有 NetBeans 7.1 的 Windows 7 主机和 VirtualBox 中的 Ubuntu VM.我将 NetBeans 项目设置为远程项目,使用 SFTP 上传和下载.
Sorry, i can't comment anymore. @David @JamesB41: I've been looking for this too. My setup is a Windows 7 host with NetBeans 7.1, and an Ubuntu VM in VirtualBox. I have the NetBeans project set up as a remote project, uploading and downloading using SFTP.
以下设置对我有用,只需使用您主机的 IP 作为 remote_host,并确保 VM 可以看到它.
The following setup works for me, just use your host's IP as remote_host, and make sure the VM can see it.
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=10.217.165.193
xdebug.remote_port=9000
xdebug.remote_log="/tmp/log/xdebug.log"
NetBeans 将在入口点断点处停止(如果您在 PHP->Debugging 中设置了选项).但是,它不会在 NetBeans 创建的断点处停止,因为它会运行 VM 的文件.不过,您可以使用 xdebug_break(),它会显示堆栈和变量. 如果您在项目配置 > 运行配置 > 高级中正确映射文件夹,它将在 NetBeans 断点处停止并突出显示.惊人的.我完整了.
NetBeans will stop at the entry point breakpoint (if you have the option set in PHP->Debugging). But, it won't stop on NetBeans-created breakpoints, because its running off the VM's files. You can use xdebug_break() though, and it will show stack and variables. It will stop at NetBeans breakpoints and highlight if you map the folders correctly in project config > Run Config > Advanced. Awesome. I am complete.
(connect_back
配置似乎没有帮助,可能是因为没有填充 $_SERVER['REMOTE_ADDR'].)
(The connect_back
config didn't seem to help, possibly because $_SERVER['REMOTE_ADDR'] isn't populated.)
这篇关于使用 Netbeans 和 XDebug 进行远程 PHP 调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!