PHP - 打印在PHP命令行脚本中执行的所有语句? [英] PHP - Print all statements that are executed in a PHP command line script?

查看:415
本文介绍了PHP - 打印在PHP命令行脚本中执行的所有语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python中,可以使用跟踪命令行脚本执行的所有语句跟踪模块。在bash中,您可以使用 set -x 执行相同操作。我们有一个PHP脚本,我们从命令行运行,像一个正常的bash / python / perl / etc脚本。没有网络正在进行。

In python, one can trace all the statements that are executed by a command line script using the trace module. In bash you can do the same with set -x. We have a PHP script that we're running from the command line, like a normal bash / python / perl / etc script. Nothing web-y is going on.

是否还有对正在执行的所有代码行的跟踪?

Is there anyway to get a trace of all the lines of code that are being executes?

推荐答案

有一个PECL扩展程序, apd ,这将生成一个跟踪文件。

There is a PECL extension, apd, that will generate a trace file.

这篇关于PHP - 打印在PHP命令行脚本中执行的所有语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆