Search code examples
debiancomposer-phphhvmxhp

composer install xhp-lib timeout


I'm just stuck trying to get Composer to work. I'm using Debian Jessie, I'm very new to linux and all of this stuff.

So, I have downloaded and installed HHVM and everything works fine. I have created a json file that looks like this:

{
    "require": {
      "facebook/xhp-lib": "~2.2"
    },
    "config": {
      "secure-http": false,
      "process-timeout": 1800
    }
}

And I still get this results with composer install:

Loading composer repositories with package information
Updating dependencies (including require-dev)
SlowTimer [60000ms] at curl: http://packagist.org/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json
The "http://packagist.org/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json" file could not be downloaded: Failed to open http://packagist.org/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json (Operation timed out after 59964 milliseconds with 636857 out of 857622 bytes received)
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
SlowTimer [60001ms] at curl: http://87.98.253.214/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json
SlowTimer [59999ms] at curl: http://87.98.253.214/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json
SlowTimer [59999ms] at curl: http://87.98.253.214/p/provider-2014%246e256ac757a31949f2560c57b83ff57649232e226864f330c6556e4134ee5d52.json


  [Composer\Downloader\TransportException]                                     
  The "http://packagist.org/p/provider-2014%246e256ac757a31949f2560c57b83ff57  
  649232e226864f330c6556e4134ee5d52.json" file could not be downloaded: Faile  
  d to open http://87.98.253.214/p/provider-2014%246e256ac757a31949f2560c57b8  
  3ff57649232e226864f330c6556e4134ee5d52.json (Operation timed out after 5967  
  4 milliseconds with 745452 out of 857622 bytes received)                     


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

I have a 10Mbps connection but it seems like it is not being used at 100%. I hope you guys can help me with this.

PS: If there is another way of integrating XHP to HHVM please tell me, sure will try.

PS: Sorry for bad English.


Solution

  • So I got this to work by running composer through HHVM. I do not know if this will help you but it worked for me.

    Please keep in mind that my error is due to a connection issue thus I was getting the

    [Composer\Downloader\TransportException] ... Operation timed out

    Forcing HHVM config options ResourceLimit.SocketDefaultTimeout & Http.SlowQueryThreshold to higher values will help you with that.


    1. Open ~/.bashrc with your prefered text editor like so sudo nano ~/.bashrc:

    2. Add this line: alias composer="hhvm -v ResourceLimit.SocketDefaultTimeout=180 -v Http.SlowQueryThreshold=300000 /usr/local/bin/composer"

    3. Save and exit the file.
    4. Run source ~/.bashrc.

    Then just run composer for your project.

    PS: That alias have very high values, it didnt take that long so please adjust that to your needs.