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 count how often apache executes a specific php function?

At the end I want I file like this:

  From 2012-01-01 till 2012-01-31 apache executed: 
  system() : 10
  printf() : 1000

I hope you get the idea.

Edit: Just to clarify things. I don't want to profile a specific php application/script. We have a shared hosting environment here and we are planning on shutting down a few php functions. Before we can do that, I would like to have an overview on how often these functions get called anyways. I don't have access to the code executed. I only can manipulate the apache (mod_php) config.

share|improve this question
Forgive me if I'm totally out of whack, but surely Apache doesn't execute any PHP functions? It passes the entire file to PHP to be processed. – Dan Dec 20 '11 at 11:02
mod_php executes them,... well thats partly apache and partly php :) – Kai Dec 20 '11 at 11:29

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.