1
votes

I'm installing laravel by using composer. But in command prompt screen, "You are running composer with xdebug enable. This has a major impact on runtime performance." this message is showing. I want to disable xdebug during laravel installation. Is there any problem, if xdebug is enabled in my system?

[Picture of my error]

2

2 Answers

3
votes

You should temporarily disable xdebug in your console's php.ini before installation dependencies with Composer:

# Set xdebug autostart to false
xdebug.remote_autostart=0
xdebug.remote_enable=0

# Disable your profiller
xdebug.profiler_enable=0

And enable it when composer install/composer update finished.

Also, you can add xdebug_disable() function in your console PHP file if you don't want to enable/disable it in php.ini each time when work with Composer:

if (function_exists('xdebug_disable')) {
    xdebug_disable();
}
1
votes

I'm using Laravel Homestead, I created a couple of aliases for turning on/off Xdebug quickly, and I use them before/after heavy composer commands, something like this:

$ xdebug_off # Disable Xdebug
  ...
$ composer heavy-load stuff
  ...
$ xdebug_on # Enable Xdebug
  ...

Once you are inside your box (after vagrant ssh), add these aliases to you ~/.profile file:

# Xdebug aliases
alias xdebug_on='sudo phpenmod xdebug; sudo service php7.0-fpm restart;'
alias xdebug_off='sudo phpdismod xdebug; sudo service php7.0-fpm restart;'

If you do this a lot, you can use my shortcut, fire this command on your virtual machine:

curl -LsS https://git.io/vrc3y  >> ~/.profile; source ~/.profile