Posts

Showing posts from August, 2015

PHP Profiling Using Xdebug and Kcachegrind

Xdebug's Profiler is a powerful tool that gives you the ability to analyze your PHP code and determine bottlenecks or generally see which parts of your code are slow and could use a speed boost. The profiler in Xdebug 2 outputs profiling information in the form of a cachegrind compatible file. This allows you to use the KCacheGrind tool (Linux,) to analyse your profiling data.  Xdebug profiler is incorporated in the Xdebug tool. Therefore you first need to download, install, and enable Xdebug itself and after that enable the profiling functionality within it. Install x-debug through apache sudo apt-get install php5-xdebug Enabling Xdebug integration with the PHP engine Once xdebug is installed, you can enable the xdebug(profiler) to work with PHP by adding following lines at the end of  php.ini  file. [xdebug]   zend_extension= "/usr/lib/php5/20121212/xdebug.so"    ;path to xdebug.so xdebug.profiler_append = 0 xdebu