Why composer install timeouts after 300 seconds?

后端 未结 9 621
南笙
南笙 2020-12-02 08:15

I have small project made in symfony2 when I try to build it on my server it\'s always fails when unzipping symfony. Build was OK and suddenly composer won\'t unzip symfony

相关标签:
9条回答
  • 2020-12-02 09:04

    Deleting composer cache worked for me.

    rm -rf ~/.composer/cache/*
    
    0 讨论(0)
  • 2020-12-02 09:05

    try composer update/install -o -vvv and check wether the package is being loaded from composer's cache.

    if yes try clearing composer's cache or try adding -cache-dir=/dev/null.

    To force downloading an archive instead of cloning sources, use the --prefer-dist option in combination with --no-dev.

    Otherwise you could try raising composer's process timeout value:

    export COMPOSER_PROCESS_TIMEOUT=600   ( defaults to 300 )
    
    0 讨论(0)
  • 2020-12-02 09:09

    This is the problem slow NFS. Composer write cache into NFS directory. You must install composer globally and rewrite cache path.

    This doesnt work:

    php composer.phar install
    

    Using this:

    composer install
    

    Before this run you must config composer globally. See this https://getcomposer.org/doc/00-intro.md#globally

    Also, you must add this lines to your config.json:

    "config": {
        "cache-dir": "/var/cache/composer"
    }
    

    Works for me.

    0 讨论(0)
提交回复
热议问题