Slow updating of composer dependencies, despite --prefer-dist flag

后端 未结 10 1738
走了就别回头了
走了就别回头了 2020-12-22 18:42

Why does it take up to two minutes for my composer dependencies to update, even when there have been no changes?

A popular suggestion is to append the --prefer-

相关标签:
10条回答
  • 2020-12-22 19:30

    I had same issue with composer update, I updated composer itself to the latest version using composer selfupdate and now it's speed acceptable.

    0 讨论(0)
  • 2020-12-22 19:30

    Indeed, xdebug is certainly going to slow things down. Uninstalling xdebug is not ideal though. A good option is to use HHVM and put it on composer duty.

    Installing HHVM is pretty painless, and HHVM itself is much more rapid than PHP5. It's a double-win -- YMMV, but I got near-5x speed increase (on the eyeball dyno admittedly) in the composer usage I'd get even if xdebug weren't in the picture.

    If you are on OS X, then this link might help (blog article I wrote on the matter):

    http://circlical.com/blog/2015/11/11/slow-composer-on-os-x

    0 讨论(0)
  • 2020-12-22 19:30

    MY SOLUTION WINDOWS 10 x 64 bits WAMP user with Laravel, after weeks of slow composer update and composer require

    you use need a thing called cacert.pem

    https://curl.haxx.se/docs/caextract.html
    

    then paste that file in your wamp main directory C:\wamp64\cacert.pem

    then in the search tab search for php.ini open all the files with that name on sublime or any text editor

    find a line called curl.cainfo and openssl.cafile

    PUT YOUR PATH TO THIS FILE - see the example on my case:

    curl.cainfo="C:\wamp64\cacert.pem"
    

    and

    openssl.cafile="C:\wamp64\cacert.pem"
    

    do this on all the php.ini files you search before, in all the files!

    OKAY RESTART SERVER that work for me, hope for you I wish someone before would make this comment! so I would not spend 2 weeks fixing it

    also call

    composer config --global repo.packagist composer https://packagist.org
    

    this make the connection on https run this too

    composer install --prefer-dist -vvv --profile
    
    0 讨论(0)
  • 2020-12-22 19:35

    Check if zip and unzip are installed. If they are missing, Composer will clone the repo instead of downloading a zipped release.

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