0

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
  etc.

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.

Kai
  • 315
  • 1
  • 4
  • 14
  • 2
    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

1 Answers1

0

See: http://xdebug.org/docs/profiler or https://stackoverflow.com/questions/21133/simplest-way-to-profile-a-php-script

Stone
  • 7,011
  • 1
  • 21
  • 33