Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: coopster & jatar k

PHP Execution Log

View or capture PHP code executed?

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

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



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



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 ]
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month