如何跟踪PHP中程序的每个“步骤”?

For example, in my error_log, it says something like:

Error... require, include, a_function, another_function

Basically it tracks each step of the program. I want to implement something like this for debugging purposes. How do I "track" the execution of the program in PHP?

You need debug_backtrace() and custom error handler

In addition to debug_backtrace() as mentioned by others, I would recommend installing Xdebug and making use of the code profiler therein. When coupled with a cachegrind application to analyze the profile, you can easily view and page through a full trace of your script's execution with execution times per function call.