composer安装xhp-lib超时

时间:2016-04-05 20:23:29

标签: debian composer-php hhvm xhp

我只是试图让Composer工作。我正在使用Debian Jessie,我对linux和所有这些东西都很陌生。

所以,我已经下载并安装了HHVM,一切正常。我创建了一个如下所示的json文件:

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

我仍然可以使用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>]...

我有一个10Mbps的连接,但它似乎没有100%使用。我希望你们可以帮助我。

PS:如果有另一种方法将XHP集成到HHVM请告诉我,肯定会尝试。

PS:抱歉英语不好。

1 个答案:

答案 0 :(得分:0)

所以我通过HHVM运行composer来实现这一点。我不知道这对你有帮助,但对我有用。

请注意,由于连接问题我的错误 因此我得到了

  

[Composer \ Downloader \ TransportException] ...操作超时

强制HHVM配置选项 ResourceLimit.SocketDefaultTimeout &amp; Http.SlowQueryThreshold 更高的值将帮助您。

  1. 使用首选文本编辑器打开〜/ .bashrc,如sudo nano ~/.bashrc:

  2. 添加以下行:alias composer="hhvm -v ResourceLimit.SocketDefaultTimeout=180 -v Http.SlowQueryThreshold=300000 /usr/local/bin/composer"

  3. 保存并退出文件。
  4. 运行source ~/.bashrc
  5. 然后只为你的项目运行composer。

    PS:别名的价值非常高,不需要那么长时间,所以请根据您的需要进行调整。