github上面fork了一個老外的指令碼,修改了一些bug和功能做的分支版本。支援作業系統ubuntu 12.04,別的系統暫時不支援。
安裝方法:
$sudo su –
#apt-get install git-core
#git clone git://github.com/xianglei/easy-hiphop.git
#cd easy-hiphop/hiphop-php
#chmod +x install-no-hhvm.sh
#./install-no-hhvm.sh

install-no-hhvm是不帶php vm的版本。可正確安裝,install.sh帶php vm,但是可能無法正確安裝,建議安裝不帶虛擬機器的版本。
安裝完成後可執行檔案在/home/dev/hiphop-php/src/hphp/hphp,指令碼會建立一個連結檔案到/usr/bin。所以,裝好了直接敲hphp就可以用。如果出現HPHP_HOME未設定的錯誤,請執行
#source /etc/profile
或者
#export HPHP_HOME=/home/dev/hiphop-php
簡單使用說明。
編譯單個php檔案。
#hphp –keep-tempdir=1 –log=4 test.php
編譯一個目錄
#hphp –keep-tempdir=1 –log=3 –input-dir=/path/to/your/php/source

編譯檔案到/tmp資料夾下找。
執行/tmp/hphp_xxxxxx/program -m server -p 8080
然後訪問伺服器的8080埠,url要輸入原檔名。比如你編譯單個test.php,需要在url裡指定
http://localhost:8080/test.php
編譯整個目錄,hiphop不能為你指定預設訪問檔案,所以,即使你是index.php,url裡面也要寫上,當然也可以用指定預設首頁的server引數方式啟動。參看facebook wiki。
http://localhost:8080/index.php
hphp –help可以檢視全部編譯引數說明。
/tmp/hphp_xxxxxx/program –help可以檢視全部啟動選項。
附一個效能測試結果,ab訪問預設url為nginx+php5.3,8080埠為hiphop編譯後。
測試環境:ubuntu 12.04 in VirtualBox,記憶體1G,CPU*2
<?php
echo rand(0,10000);
?>

nginx+php:
Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests

Server Software:                nginx/1.1.19
Server Hostname:                localhost
Server Port:                        80

Document Path:                    /easyhadoop/test.php
Document Length:                4 bytes

Concurrency Level:            200
Time taken for tests:     48.693 seconds
Complete requests:            100000
Failed requests:                10169
     (Connect: 0, Receive: 0, Length: 10169, Exceptions: 0)
Write errors:                     0
Non-2xx responses:            3
Total transferred:            16289226 bytes
HTML transferred:             389247 bytes
Requests per second:        2053.68 [#/sec] (mean)
Time per request:             97.386 [ms] (mean)
Time per request:             0.487 [ms] (mean, across all concurrent requests)
Transfer rate:                    326.69 [Kbytes/sec] received

Connection Times (ms)
                            min    mean[+/-sd] median     max
Connect:                0        1     1.7            0            37
Processing:         9     94 217.0         61     13281
Waiting:                8     94 217.0         61     13281
Total:                 42     95 217.1         62     13297

————————————-
HipHop:
Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests

Server Software:                
Server Hostname:                localhost
Server Port:                        8080

Document Path:                    /test.php
Document Length:                4 bytes

Concurrency Level:            200
Time taken for tests:     26.778 seconds
Complete requests:            100000
Failed requests:                10129
     (Connect: 0, Receive: 0, Length: 10129, Exceptions: 0)
Write errors:                     0
Total transferred:            10188711 bytes
HTML transferred:             388711 bytes
Requests per second:        3734.36 [#/sec] (mean)
Time per request:             53.557 [ms] (mean)
Time per request:             0.268 [ms] (mean, across all concurrent requests)
Transfer rate:                    371.57 [Kbytes/sec] received

Connection Times (ms)
                            min    mean[+/-sd] median     max
Connect:                0     16 154.5            0     15032
Processing:        10     36    65.5         35     13901
Waiting:                7     35    65.5         34     13900
Total:                 28     52 176.0         35     15066

均是100000個request,200個concurrency。試過開到500個concurrency,nginx直接掛了。hiphop還能跑。
nginx 4程式+php4程式ab測試處理請求2000個每秒,響應時間0.48秒。
hiphop 單程式,ab測試處理請求3700個每秒,響應時間0.26秒。
無論是請求數還是響應時間都大大提高。
執行引數可參看facebook官方wiki