使用 Zend 远程调试 PHP 命令行脚本?

发布于 2024-07-04 12:06:51 字数 481 浏览 6 评论 0原文

我正在使用 Zend Studio 在开发人员上远程调试我的 php 脚本服务器。 它非常适合 Web 代码,但我可以让它与命令行脚本一起使用吗?

我有几个帮助应用程序来运行我的应用程序。 通过命令行而不是网络浏览器启动远程调试器非常有用,这样我就可以测试它们。

我认为这是可能的,因为我认为 Zend 正在使用 xdebug 与 Eclipse 对话。 显然,它向请求添加了一些参数,以根据请求唤醒 Zend 代码。 我想我需要利用这一点?

更新

我最终在 X 上使用 xdebug 和 protoeditor 来进行调试。

I'm using Zend Studio to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?

I have several helper apps to make my application run. It would be really useful to fire up the remote debugger through command line instead of a web browser so I can test these out.

I assume it's possible, since I think Zend is using xdebug to talk to Eclipse. Apparently, it adds some parameters to the request to wake the Zend code up on a request. I'm guessing I'd need to tap into that?

UPDATE

I ended up using xdebug with protoeditor over X to do my debugging.

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

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

发布评论

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

评论(5

坏尐絯 2024-07-11 12:06:51

我能够进行 远程 CLI 调试Eclipse,使用 xdebug,尽管我还没有使用 zend 调试器尝试过。 我认为这应该与 ZSfE 一样工作,如果那是您使用的“Zend Studio”。

I was able to get remote CLI debugging working in Eclipse, using xdebug, though I've not tried it with the zend debugger. I would assume this should work the same with ZSfE, if that's the "Zend Studio" you're using.

木緿 2024-07-11 12:06:51

由于这更多的是产品支持,因此您最好的选择可能是向支持人员发送电子邮件。 我们在上一份工作中购买了 Zend Studio,他们总是能够在几个小时内为我们提供帮助。

请随意发布答案,我相信还有更多的人在寻找它。 :)

Since this is more along the lines of product support, your best bet is probably emailing the support people. We bought Zend Studio at my last job and they were always able to help us in a matter of hours.

Feel free to post the answer though, I am sure there are more people looking for it. :)

猫卆 2024-07-11 12:06:51

有一个选项可以调试 php 脚本,
run->run as->php 脚本

我相信它也必须位于您的项目根目录中。 澄清一下,Zend studio 使用他们自己的调试器,而 eclipse pdt 项目则可以选择 Xdebug 或 Zend 的调试器。

There's an option to debug a php script,
run->run as->php script

I believe it also has to be in your project root though. Just for clarification, Zend studio uses their own debugger, while the eclipse pdt project you have the option for Xdebug or Zend's debugger.

野稚 2024-07-11 12:06:51

尚未尝试过,但您可以将 QUERY_STRING 环境变量设置为打开 Zend 调试器的变量。

根据这篇文章< /a>.

export QUERY_STRING=start_debug=1&debug_host=<host name or IP of the local machine>&debug_port=<the port that is configured in your ZDE settings>&debug_stop=1

然后运行 ​​CLI 脚本。

Haven't tried, but you can set the QUERY_STRING environment variable to the one that toggles the Zend debugger on.

Per this article.

export QUERY_STRING=start_debug=1&debug_host=<host name or IP of the local machine>&debug_port=<the port that is configured in your ZDE settings>&debug_stop=1

And then run the CLI script.

流殇 2024-07-11 12:06:51

远程命令行调试是可以的,我刚刚尝试过。
就我而言,我使用 Zend Studio + Zend 调试器。

Zend此处 > 人们会帮助你,这就是我用过的。 它解释了 shell 命令中必须包含的所有参数。

确保您在远程服务器上正确设置了 php.ini,并且它允许您的 IP 地址并且可以正常工作。

此外,您不需要导出 QUERY_STRING 变量。

你可以这样做:

QUERY_STRING="start_debug=1&debug_host=[127.0.0.1]&no_remote=0&debug_port=10137&debug_stop=0" /path/to/php/binary/your/php/script.php

在 SSH shell 上运行将点亮您的 Zend Studio。 甜的!

Remote command-line debugging is possible, I just tried it.
In my case I used Zend Studio + Zend Debugger.

This official article here by the Zend people will help you out, it's what I used. It explains all the parameters that must go into the shell command.

Make sure that you have the php.ini properly set on the remote server, and that it allows your IP address and it will work.

Also, you don't need to export the QUERY_STRING variable.

You can just do:

QUERY_STRING="start_debug=1&debug_host=[127.0.0.1]&no_remote=0&debug_port=10137&debug_stop=0" /path/to/php/binary /your/php/script.php

Running that on an SSH shell will light up your Zend Studio. Sweet!

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