2016-04-05 30 views
0

我只是試圖讓Composer工作。我使用的是Debian Jessie,我對linux和所有這些東西都很陌生。作曲家安裝xhp-lib timeout

因此,我已經下載並安裝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:對不起,英語不好。

回答

0

因此,我通過HHVM運行作曲者來實現這一目標。我不知道這是否會幫助你,但它對我有用。

請記住,我的錯誤是由於的連接問題,因此我得到了

[作曲\下載\ TransportException] ...操作超時

強制HHVM配置選項ResourceLimit.SocketDefaultTimeout & 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

然後,只需運行您的項目的作曲家。

PS:該別名具有非常高的值,它沒有花費那麼長時間,所以請根據您的需要進行調整。