LoginSignup
9
9

More than 5 years have passed since last update.

HHVM 3.0.1をCentOSにインストールしてnginxでHipHop

Last updated at Posted at 2015-03-08

HHVMをCentOSにインストールしたのでメモ

まずはHHVMインストール

$ cd /etc/yum.repos.d
$ sudo wget http://www.hop5.in/yum/el6/hop5.repo
$ sudo yum clean all
$ sudo yum install hhvm
$ sudo yum update hiphop-php

インストール中に下記のエラーがでた。。。。。

Error: Package: hhvm-3.2.0-1.el6.x86_64 (hop5)
Requires: libmcrypt >= 2.5.8
Error: Package: ImageMagick-libs-6.8.6.3-4.el6.x86_64 (hop5)
Requires: liblcms2.so.2()(64bit)
Error: Package: hhvm-3.2.0-1.el6.x86_64 (hop5)
Requires: libmcrypt.so.4()(64bit)

なので必要なライブラリを入れたもう一度チャレンジ

wget http://pkgrepo.linuxtech.net/el6/release/x86_64/liblcms2-2.4-1.el6.x86_64.rpm
yum install liblcms2-2.4-1.el6.x86_64.rpm

無事インストールできたら下記で確認する
$ hhvm --version

HipHop VM 3.2.0 (rel)
Compiler: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
Repo schema: c52ba40f4a246d35a88f1dfc1daf959851ced8aa

nginxのインストール

$ sudo yum install nginx

設定ファイルを変更する
vi /etc/nginx/conf.d/default.conf

location / {
root /var/www/html;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?\$args;
}
location ~ .php\$ {
root /var/www/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

ドキュメントルートにファイルを作成する
vi /var/www/html/index.php

<?hh
phpinfo();

※hackのファイルは閉じカッコがあるとエラーで動かないので注意

nginxとhhvmを起動する

$ sudo /etc/init.d/nginx start
$ sudo hhvm --mode server -vServer.Type=fastcgi -vServer.Port=9000

でブラウザからアクセスしてHipHopってでればOK

9
9
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
9
9