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:


0 0 vote
Article Rating

By Sinaru Gunawardena

Sinaru is a software developer at work and a painter in free time. He enjoys writing tech notes on his personal website. He currently lives in Dublin, Ireland.

Notify of
Inline Feedbacks
View all comments