1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntuにhhvmをインストール(vagrant+virtualbox)

Posted at

hhvm+hackを実行できる環境を構築するメモ
まずは、ubuntu環境を作る

$ mkdir precise64
$ cd precise64

boxファイルのダウロード

$ vagrant box add precise64 http://files.vagrantup.com/precise64.box
Successfully added box 'precise64' with provider 'virtualbox'!

初期化して、vagrantfile作成

$ vagrant init precise64
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"
  config.vm.network :private_network, ip: "192.168.33.11"
end

起動して、確認。

$ vagrant up
$ vagrant ssh
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"

パッケージの更新をしておく

$ sudo apt-get update
$ sudo aptitude install python-software-properties

hhvmのインストール。以下を参考に
https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Ubuntu-12.04

$ sudo add-apt-repository ppa:mapnik/boost
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
$ echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
$ sudo apt-get update
$ sudo apt-get install hhvm

Hello Worldのサンプルコードを記述

:hello.hh
<?hh
echo 'Hello World!';

.hhconfig作成後に、実行

$ touch .hhconfig
$ hhvm hello.hh
Hello World!

とりあえず、ここまで。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?