Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling PHP running in apache

I want to know what functions are being called and what time each request is taking for an application which is running on apache.

Is there any tool or any other way where i can get this data.
I also want to know how much time each function is taking.

The application is running it cannot be stopped.
So i need to get the details in the running environment itself.
Thanks in advance.

like image 373
gaurav Avatar asked Oct 12 '25 11:10

gaurav


2 Answers

One of the most used industry tools for this is: http://www.xdebug.org/

I have used it religiously for a long time now! From it's front-page it does the following:

"The Xdebug extension helps you debugging your script by providing a lot of valuable debug information. The debug information that Xdebug can provide includes the following:

* stack traces and function traces in error messages with:
      o full parameter display for user defined functions
      o function name, file name and line indications
      o support for member functions
* memory allocation
* protection for infinite recursions"
like image 163
Brian Avatar answered Oct 14 '25 07:10

Brian


Xdebug can write a profiling file that you can analyze in kcachegrind or wincachegrind.

like image 37
AndreKR Avatar answered Oct 14 '25 05:10

AndreKR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!