PHP profiling using webgrind and Xdebug

Install xdebug

sudo apt-get install php5-xdebug

Then update config

Add following line in /etc/php5/fpm/conf.d/20-xdebug.ini

xdebug.profiler_enable = 1
xdebug.profiler_output_dir = /tmp

After that please restart php5-fpm

sudo service php5-fpm restart

Load page you want to optimize

It will take time (If its taking too much time then need to optimize 😛 )

Install webgrind

Simply decompress the package into a folder in your server and load its path it in the browser. It is written in php5 and it does not have dependencies to configure.

wget && unzip

Open webgrind in your browser and observing the result

You can get more details from github