使用vagrant,hhvm和Ubuntu 14.04安装Composer [英] Installing composer using vagrant, hhvm, and Ubuntu 14.04

查看:88
本文介绍了使用vagrant,hhvm和Ubuntu 14.04安装Composer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在流浪者配置脚本的结尾,我尝试使用以下命令安装composer:

At the end of my vagrant provisioning script I attempt to install composer using the following :

sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

但是什么时候被执行时,出现以下错误:

However when this is executed I get the following errors :

SlowTimer [5612ms] at curl: https://getcomposer.org/composer.phar
Download failed: Failed to open https://getcomposer.org/composer.phar (Resolving timed out after 5613 milliseconds)
The download failed repeatedly, aborting.

如果我安装了php而不是hhvm,并在无业游民的vm上运行了相同的命令,则安装成功表示hhvm不兼容。但是我也有一个运行Ubuntu 14.04和hhvm(没有php)的Linode,可以使用这些命令安装composer而不会有任何问题。

If I have php installed rather than hhvm and run the same commands on my vagrant vm the install is successful which indicates an incompatibility in hhvm. However I also have a Linode running Ubuntu 14.04 and hhvm (no php) and can install composer using these commands without any problems.

鉴于我可以在类似的环境中安装composer在我的Linode上,为什么它在我无所事事的虚拟机上失败,我该如何纠正?

Given I can install composer using a similar environment on my Linode why does it fail on my vagrant vm and how do I rectify this?

推荐答案

已在流浪汉,hhvm或存在根本原因的地方修复,可以使用wget下载作曲家安装程序:

As a work around until this gets fixed in vagrant, hhvm or where ever the root cause exisits you can download the composer installer using wget:

sudo wget https://getcomposer.org/installer

然后使用hhvm安装作曲程序,并提供一些建议的超时选项< a href = http://vanderveer.be/speed-up-composer-by-using-hhvm-includes-a-slowtimer-error-fix/ rel = noreferrer>此处。

Then install composer using hhvm with some options to extend the timeouts as recommended here.

hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 installer

然后像往常一样在全局安装作曲家并清理:

Then install composer globally as usual and clean up :

sudo mv composer.phar /usr/local/bin/composer
sudo rm installer

这篇关于使用vagrant,hhvm和Ubuntu 14.04安装Composer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆