diff --git a/doc/articles/troubleshooting.md b/doc/articles/troubleshooting.md index 8e5d9afb0..aeb50c5fa 100644 --- a/doc/articles/troubleshooting.md +++ b/doc/articles/troubleshooting.md @@ -131,6 +131,23 @@ Or, you can increase the limit with a command-line argument: php -d memory_limit=-1 composer.phar <...> ``` +## Xdebug impact on Composer + +Running Composer console commands while the php extension "xdebug" is loaded reduces speed considerably. +This is even the case when all "xdebug" related features are disabled per php.ini flags, +but the php extension itself is loaded into the PHP engine. +Compared to a cli command run with "xdebug" enabled a speed improvement by a factor of up to 3 is not uncommon. + +> **Note:** This is a general issue when running PHP with "xdebug" enabled. You shouldn't +> load the extension in production like environments per se. + +Disable "xdebug" in your `php.ini` (ex. `/etc/php5/cli/php.ini` for Debian-like systems) by +locating the related `zend_extension` directive and prepending it with `;` (semicolon): + +```sh +;zend_extension = "/path/to/my/xdebug.so" +``` + ## "The system cannot find the path specified" (Windows) 1. Open regedit. diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 64df3eab8..710bf9f32 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -94,6 +94,10 @@ class Application extends BaseApplication if (PHP_VERSION_ID < 50302) { $io->writeError('Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.'); } + + if (extension_loaded('xdebug')) { + $io->write('You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug'); + } if (defined('COMPOSER_DEV_WARNING_TIME')) { $commandName = '';