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 https://webgrind.googlecode.com/files/webgrind-release-1.0.zip && unzip webgrind-release-1.0.zip

Open webgrind in your browser and observing the result

You can get more details from github

Advertisements

One thought on “PHP profiling using webgrind and Xdebug

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s