需要有关在 CLI 上调用的 PHP 脚本中的局部变量的舒适信息
我的设置如下所示:
我在 WinXP 上工作,而我的测试环境(Debian / Apache / MySQL / Squid / PHP / XDebug / ...)在 VMWare 环境中运行。项目文件可以在共享文件夹中直接访问,因此我可以使用 Eclipse 进行 XDebugging。
现在我有一个必须在 CLI 上调用的脚本,我想执行尽可能类似于通常的 XDebugging 的操作...不一定是实时的,但我需要有关何时调用哪个方法以及任何值持有什么值的信息基本上,任何给定时间的局部变量或属性。
我该如何做到这一点?
我生成了一个 XDebug 配置文件,但在 Wincachegrind 中检查它并没有揭示任何有关变量的信息。
据我了解,Eclipse-PDT 的 CLI 调试似乎因无法访问 PHP 解释器而失败。
我很高兴不必到处放置回声。
我对几乎任何一种解决方案都持开放态度,如果它与 XDebug 无关的话,但我想是否有一个它与之相连。
最佳
拉斐尔
My setup looks like this:
I work on WinXP, while my Test-Environment (Debian / Apache / MySQL / Squid / PHP / XDebug / ...) is running in a VMWare-environment. The project files are directly accessible in a shared folder, so I can do XDebugging using Eclipse.
Now I have a script that has to be invoked on the CLI and I want to perform something as similar as possible to the usual XDebugging ... not neccessarily live but I need information about which method is invoked when and what value is held by any local variable or attribute at any given time, basically.
How do I accomplish that?
I produced an XDebug-profile, but examining it in Wincachegrind did not reveal anything about variables whatsoever.
The CLI-Debugging from Eclipse-PDT seems to founder on the non-available access to the PHP-interpreter, as far as I understand the problem.
I would be happy not having to place echos everywhere.
I'm open for pretty much anykind of solution also if it is not trelated to XDebug, but I guess if there is one it's connected to it.
Best
Raffael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的调查显示存在一些我到目前为止尚未使用的 xdebug 功能,这些功能可能可以完成这项工作。由于某些限制,我无法亲自尝试。
但我想我可以在另一个 php 文件中 require_once php 脚本,我只是将其放入一个可以从浏览器访问的文件夹中。所以我刚刚使用这个中间人从 Eclipse 启动了我的 XDebug-Session。
My investigations revealed the existence of some xdebug-features I didn't use so far which might do the job. Due to certain restrictions I couldn't try my hand at it.
But I figured that I could just require_once the php-script within another php-file which I just put into a folder that I could access from my browser. So I just started my XDebug-Session from Eclipse using this go-between.