Improving PHP Xdebug Speed

Great, you have finally figured out how to install and enable PHP Xdebug. Now you can debug your PHP websites and web apps in your local machine. However what you might found out is that after enabling Xdebug, your website’s response time is very low. You might have to wait for more like a second to display your website.

Disabling profiler

As I found out, the main reason for this is the Xdebug profiler. If Xdeubg profiler is enabled, it will add some significant overhead to the PHP execution. Profiling enables us to get execution statistics such as name of functions executed, the number of times a function has called, execution time etc. This can give information on how to improve the code.

For general debugging, profiling is not needed. So we can disable it by updating the php.ini file and restart the server. Now your web application response time should be greatly improved.

xdebug.profiler_enable = 0;

Well if you want to enable it again, you can set the value to ‘1’ and restart the server. Another way is to use the profiler_enable_trigger cookie. For this first we need to specify value for it.

xdebug.profiler_enable_trigger = 1;

Now to enable profiler for an app request, you need to have the Xdebug profiler cookie set to this value. In Firefox Developer Edition, I use The Easiest Xdebug add on to do this. With this addon, I can easily specify the profiler_enable_trigger value and then before request the website, I would click a button to set the cookie value.

Setting remote host to

Typically you would put localhost as the xdebug.remote_host, but I found out that there is a slight lag in Windows when referring localhost to So replace localhost to The special IP is referring to the current machine you are using.

Additional References

PHP Applications Profiling in PhpStorm:

Xdebug Documentation basic features:

Firefox : The easiest Xdebug:



Setting up xdebug with phpstorm

This guide provide a step by step details on how to set up phpstorm IDE to work with xdebug.


Installing on Ubuntu

In software search for xdebug and install.


Add to the following xdebug settings to php.ini file


xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req




Installing on Windows XAMPP

First download xdebug and copy it into the extension folder. Copy the full path the extension.


Add the following xdebug settings to php.ini file.

php.ini file

zend_extension = "C:xamppphpextphp_xdebug-2.2.5-5.5-vc11.dll"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir ="c:tmpxdebug"





Install easiest xdebug for Firefox and specify the remote IDE key for Firefox



Then in the xdebug configuration apply following




Put debug points and run the remote debug setting.




enable the easiest debug and navigate the test page through the browser. Your debug point should be hit, the request url is reading the debug file.



To stop breaking at the first line Untick Run->break and first lineā€¦