我使用composer安装laravel。但是在命令提示符屏幕中,"您正在使用xdebug enable运行composer。这对运行时性能有重大影响。"此消息正在显示。我想在laravel安装期间禁用xdebug。如果在我的系统中启用了xdebug,有什么问题吗?
[]
答案 0 :(得分:3)
在使用Composer安装依赖项之前,您应该暂时禁用控制台php.ini
中的xdebug:
# Set xdebug autostart to false
xdebug.remote_autostart=0
xdebug.remote_enable=0
# Disable your profiller
xdebug.profiler_enable=0
在composer install
/ composer update
完成后启用它。
此外,如果您不想在每次使用Composer时在xdebug_disable()
中启用/禁用它,您可以在控制台PHP文件中添加php.ini
函数:
if (function_exists('xdebug_disable')) {
xdebug_disable();
}
答案 1 :(得分:1)
我使用Laravel Homestead,我创建了几个别名来快速打开/关闭Xdebug,我在重型作曲家命令之前/之后使用它们,如下所示:
$ xdebug_off # Disable Xdebug
...
$ composer heavy-load stuff
...
$ xdebug_on # Enable Xdebug
...
进入收件箱后(vagrant ssh
之后),将这些别名添加到~/.profile
文件中:
# 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;'
如果您经常这样做,可以使用我的快捷方式,在您的虚拟机上启动此命令:
curl -LsS https://git.io/vrc3y >> ~/.profile; source ~/.profile