Local Community

How can I disable the Xdebug PHP extension?

What is Xdebug?

Local ships with a PHP extension called Xdebug, which allows developers to get an in-depth look into the PHP processes that a given Local site is running. If you’re a PHP developer frequently using var_dump() or echo to debug, we highly recommend learning how to leverage Xdebug in your editor of choice!

Since Xdebug hooks into every part of PHP, it can cause complex sites to run slower than it would without Xdebug.

If you’re not taking advantage of the features that Xdebug provides, disabling Xdebug is an easy way to get a performance boost in Local.

How can I disable Xdebug in Local 5 and newer?

Note: These instructions will disable Xdebug on a per-site basis. New sites will have Xdebug enabled by default unless you create a site with a Blueprint that has Xdebug disabled.

  1. Navigate to the site’s folder by clicking on the arrow beside the site path in Local

  2. Browse to the site’s conf/php/php.ini.hbs file and open it

  3. Scroll down to the section starting with [xdebug] and enter {{!-- on the line above it. Add a new line beneath xdebug.profiler_enable=0 containing --}}

  4. Verify that the Xdebug section in the php.ini.hbs file looks similar to the following:

  5. Save the changes in php.ini.hbs

  6. Restart the site in Local by right-clicking on it in Local’s sidebar and clicking “Restart”. This will load the PHP config changes.

  7. Verify that Xdebug is disabled by opening up the PHP info screen for the site. This can be done by clicking on the i beside the site’s PHP version.

    If Xdebug is correctly disabled, you should see no mention of it on this page: