Disabling xdebug when running composer

前端 未结 18 1198
北海茫月
北海茫月 2021-01-29 21:18

When running composer diagnose, I get the following error :

The xdebug extension is loaded, this can slow down Composer a little. Disablin

18条回答
  •  离开以前
    2021-01-29 21:22

    By creating an alias you'll suppress that composer xdebug error message.

    Just add this line to your ~/.bash_aliases within your system and it should work flawlessly.

    alias composer="php -n /usr/local/bin/composer"
    

    Reload the shell to make the new alias composer available.

    source ~/.bash_profile
    

    USAGE:

    $ composer --version
    

    NOTE:
    You don't necessarily need to use any other parameter.
    Depending on your system you might have a .bashrc instead of .bash_profile.

    UPDATE:

    As @AlexanderKachkaev mention in the comments it's worth nothing to add the memory_limit as follows to avoid crashing im some situations:

    alias composer="php -d memory_limit=-1 -n /usr/local/bin/composer"
    

提交回复
热议问题