当 PHP 和网站文件位于另一台服务器上时,使用 Eclipse/PDT 调试网站...如何?

发布于 2024-10-09 16:32:07 字数 438 浏览 0 评论 0原文

以下情况:

我的电脑上运行的是 Windows 7。 还有带有 PDT 的 Eclipse 和 VMWare,这是我的“服务器”。

在 VM 中,我运行 Debian 5、Apache、PHP + XDebug 和 OpenSSH-Server。

我可以使用 IP 192.168.0.128 和端口 3128 使用 Putty 连接到 Debian。

在我的 Win7 主机上没有可用的 PHP。

如何让 Eclipse 与 VM 上的 XDebug 连接?

我在这里有点迷失,因为我似乎缺乏一些必要的网络基础知识。有人可以给我一个提示,哪个“单词组合”将引导我使用 Google 找到解决方案,通常这就是您所需要的 Google +“正确的单词”......隧道?偏僻的? ...到目前为止,所有这些都让我误入歧途。

谢谢

拉斐尔

Following situation:

Windows 7 running on my PC.
Also Eclipse with PDT and VMWare, which is my 'server'.

Within the VM I have Debian 5 running, Apache, PHP + XDebug and OpenSSH-Server.

I can connect to Debian with Putty using the IP 192.168.0.128 and Port 3128.

On my Win7-host there is no PHP available.

How can I get Eclipse to connect with XDebug on the VM?

I'm a bit lost here, 'cause I seem to lack some necessary network-basics. Could someone please give me a hint which 'combination of words' will lead me to the solution using Google, usually that's all you need Google + 'the right words' ... tunneling? remote? ... all lead me astray so far.

Thanks

Raffael

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寒尘 2024-10-16 16:32:07

在 Debian 虚拟服务器上的 php.ini 中,XDebug 应该设置一些配置变量。其中之一是xdebug.remote_host。它现在可能设置为“localhost”。它需要指向您的 Win7 PC 的 IP 地址。

在 php.ini 中(确保您正在编辑 Apache 正在使用的文件,而不是 PHP CLI 正在使用的文件...它们可能相同,也可能不同):

xdebug.remote_enable=on
xdebug.remote_host=192.168.0.999

其中 192.168 .0.999 替换为 PC 的 IP 地址。

您需要确保 xdebug.remote_port 和 xdebug.remote_handler 也设置为 Eclipse 插件期望的值。

指定 xdebug.remote_host 的替代方法是使用 xdebug .remote_connect_back。我从未设置过它,所以除了向您指出 XDebug 的文档之外,我无法为您提供更多帮助。

请注意,您可能需要其他 php.ini 设置才能正确设置。我不是 Eclipse 用户,所以我不熟悉它的特殊需求(如果有的话)。您正在使用的 Eclipse 插件的 XDebug 文档或文档站点可能会为您提供基本的安装和要求指南。

如果您不确定 Apache 使用的是哪个 php.ini,请创建一个包含 phpinfo(); 的 php 文件(除了 之外,不要有其他内容)开始),然后使用浏览器通过 Apache 服务器访问该文件(将其放在 Web 服务器的根目录中)。查找“已加载的配置文件”...应该位于顶部附近。

In php.ini on your Debian virtual server, XDebug should have some configuration variables set up. one of them is xdebug.remote_host. It is probably set to "localhost" right now. It needs to point back to your Win7 PC's IP address.

In php.ini (make sure you are editing the one that Apache is using, not the one that PHP CLI is using...they may or may not be the same):

xdebug.remote_enable=on
xdebug.remote_host=192.168.0.999

Where 192.168.0.999 is replaced with the PC's IP address.

You need to make sure that xdebug.remote_port and xdebug.remote_handler are set to the value that your Eclipse plugin is expecting too.

An alternative to specifying an xdebug.remote_host would be to use xdebug.remote_connect_back. I've never set that up, so I can't help you more than point you XDebug's docs.

Note that you may need other php.ini settings to set yourself up properly. I'm not an Eclipse user, so I'm not familiar with its special needs (if any). The XDebug docs or the documentation site for the Eclipse plugin you are using will probably have a basic installation and requirements guide for you.

If you are not sure which php.ini Apache is using, create a php file with phpinfo(); in it (and nothing else, other than <?php to start things out), and then access that file using your browser through the Apache server (drop it in the root directory of the web server). Look for "Loaded Configuration File"... should be near the top.

德意的啸 2024-10-16 16:32:07

感谢您的努力。

对于存档,我的配置:

xdebug.ini:

xdebug.remote_autostart = Off

xdebug.remote_enable = On

xdebug.remote_mode=req

xdebug.remote_host=[HIP]

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

xdebug.remote_log=/var/ log/apache2/xdebug_remote

xdebug.profiler_enable = 1

[HIP] 你通过netstat获得,在我的例子中,它是(唯一的)SSH连接,b/c的putty。

php.ini:

zend_extension=[在 xdebug.ii 中找到的路径]

Eclipse:

调试器: XDebug
服务器:VM 的 IP

这基本上为我完成了。

最佳

拉斐尔

thanks for the effort.

For the archive, my configurations:

xdebug.ini:

xdebug.remote_autostart = Off

xdebug.remote_enable = On

xdebug.remote_mode=req

xdebug.remote_host=[HIP]

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

xdebug.remote_log=/var/log/apache2/xdebug_remote

xdebug.profiler_enable = 1

[HIP] you get through netstat, in my case it's the (only) SSH conncetion, b/c of putty.

php.ini:

zend_extension=[path you find in xdebug.ii]

Eclipse:

Debugger: XDebug
Server: IP of VM

That did it for me, basically.

Best

Raffael

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文