Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to log execution time of any php scripts running on a webserver? The server is setup similar to a shared hosting setup, except that our customers don't control their hosting or websites. I'm hoping for a way I can use either the apache logs, or perhaps something in php.ini that I can use to track unusually long running scripts without writing some code and inserting it into the footers of 225+ websites.

Ideas?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Check out http://code.google.com/p/mod-log-firstbyte/ This will add the %F option which you can add to your Apache access.log configuration.

share|improve this answer
    
Perfect, that's exactly what I needed. Now, I thought php could start outputting before the script finishes...or does apache only start output until php finishes? –  CWSChris Oct 7 '10 at 19:55
    
It starts only when PHP is done. Try it out: <?php echo "x"; sleep(5); echo "y"; ?> –  faker Oct 7 '10 at 20:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.