Welcome to WebmasterWorld Guest from 54.224.253.82

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP Execution Log

View or capture PHP code executed?

     
5:59 pm on Mar 5, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 26, 2004
posts: 3150
votes: 12


I'm curious if there is a way to somehow capture the PHP code executed when loading a page locally on my system? If so I'd like to be able to compare it to different builds for performance comparisons.

Perhaps a log output similar to this...

file1.php 
include('file2.php');
file2.php
echo 'Hi Mom!';
file1.php
echo 'second line';
echo 'third line executed here';
echo 'etc';


- John
9:08 pm on Mar 5, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 26, 2004
posts: 3150
votes: 12


Well I did a bit of digging and came across Xdebug Profiler. In conjunction with WinCacheGrind I was able to find a single line of code that was adding 40 milliseconds of wait to page loads and fixed it. :)

- John
10:03 pm on Mar 5, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 1, 2003
posts:815
votes: 0


Sounds like you are asking for a PHP tracing tool. There is not a built-in trace in PHP, but several extensions exist to accomplish this.

A search for "php tracing" will turn up extensions you could use, including Zend's xdebug and DTrace.

Here's a good intro showing what DTrace can do:

[wikis.sun.com ]