How to trace code execution in PHP?

Martin Vseticka picture Martin Vseticka · Jan 15, 2013 · Viewed 46k times · Source

I would like to see a log of THE WHOLE code execution of PHP script(s). Something like this: http://en.wikibooks.org/wiki/Ruby_Programming/Standard_Library/Tracer (for lack of better example; no flame please).

Is there some way how to obtain the log in PHP?

Note: I know I can use a debugger but that's not the same.

Answer

BenLanc picture BenLanc · Jan 15, 2013

Xdebug is definitely what you want, but with something like callgrind from the valgrind suite as well.

Zend blog post here should give you some pointers: http://devzone.zend.com/1139/profiling-php-applications-with-xdebug/