Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
up vote 1 down vote accepted

Check out 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


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