Bookmark and Share

Thursday, March 29, 2018

Wordpress php performance analysis

If you need to check the performance of your Wordpress installation (or any PHP application) you can use the awesome XDEBUG Extension for PHP.

Steps to follow:

  • On the web server open a command/shell and execute
    php -i > c:\phpinfo.txt
  • Copy the output fron the phpinfo.txt
  • Connect to
  • Copy the phpinfo and analyze it using the wizard:
  • Click “Analyze”, they will give you installation instructions:

Here are the steps I followed on windows:

  • On windows download the  dll
  • Copy it in your PHP extension PATH , example : C:\Program Files\PHP\v7.1\ext
  • Edit the php.ini file, i.e : C:\Program Files\PHP\v7.1\php.ini
  • Add on the top these commands:
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_dir = "C:/Temp/"
  • Be sure the C:\Temp folder exists, the logs will be copied here
  • Add also this line :
    zend_extension = "c:\Program Files\PHP\v7.1\ext\php_xdebug-2.6.0-7.1-vc14-nts-x86_64.dll"

After you followed the installation instructions here is the analysis part:

  • Install this tool :, it’s the log viewer
  • Reload your page, the c:\Temp folder should start to be populated with “cachegrind.out” files
  • Note that the page will be slower…. so don’t forget to comment all commands after your analysis finishes.
  • Open QCacheGrind
  • Open the log file
  • Activate the Callee Map on the right:
  • It seems I have a problem related to the “sqli_real_connect”….
  • Investigate and fix the problem (in my case I used the db name localhost instead of
  • Analyze again….
  • Well, the sqli_real_connect problem seems fixed.

Hope it helps!

    No comments:

    Post a Comment