当前位置:  开发笔记 > 编程语言 > 正文

如何安装hiphop for php?

如何解决《如何安装hiphopforphp?》经验,为你挑选了1个好方法。

大多数devepolers都知道Facebook的Hiphop for php,我想在我的脚本中使用它,但不知道从哪里开始.

我应该和服务器提供商说话吗?或者我需要在脚本中添加一些代码吗?



1> Alasdair..:

HipHop很难安装,但幸运的是你我刚刚经历过它!

您需要一台专用服务器,最容易安装在Red Hat或CentOS或Amazon Linux上.您无法在共享主机上安装它,您需要root访问权限.

它也更容易安装在干净的服务器上(只是操作系统).

我建议您从Amazon Web Services获取一个干净的Instance并在其上安装,您可以在不需要时将其关闭.它不贵.

这将把它安装在AWS实例上,一次将它放入SSH一行:


sudo su -
export LDFLAGS="$LDFLAGS -lrt"
export CMAKE_PREFIX_PATH=/home/ec2-user/hiphop/local
export HPHP_HOME=/home/ec2-user/hiphop/hiphop-php
export HPHP_LIB=/home/ec2-user/hiphop/hiphop-php/bin
ldconfig
yum -y install git cmake boost pcre-devel libicu-devel libmcrypt-devel oniguruma-devel mysql-devel gd-devel boost-devel libxml2-devel libcap-devel binutils-devel flex bison expat-devel patch gcc gcc-c++ bzip2 bzip2-devel memcached openldap openldap-devel readline-devel libc-client-devel pam-devel
mkdir /home/ec2-user/hiphop
cd /home/ec2-user/hiphop
git clone git://github.com/facebook/hiphop-php.git
wget "http://downloads.sourceforge.net/project/re2c/re2c/0.13.5/re2c-0.13.5.tar.gz?use_mirror=cdnetworks-us-2"
wget "http://www.threadingbuildingblocks.org/uploads/77/142/2.2/tbb22_20090809oss_src.tgz"
wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2
wget http://www.monkey.org/~provos/libevent-1.4.14-stable.tar.gz
wget http://launchpad.net/libmemcached/1.0/0.48/+download/libmemcached-0.48.tar.gz
tar xvjf curl-7.20.0.tar.bz2
tar xvzf libevent-1.4.14-stable.tar.gz
tar xvzf re2c-0.13.5.tar.gz
tar xvzf tbb22_20090809oss_src.tgz
tar xvzf libmemcached-0.48.tar.gz
export LDFLAGS="$LDFLAGS -lrt"
export CMAKE_PREFIX_PATH=/home/ec2-user/hiphop/local
cd /home/ec2-user/hiphop/tbb22_20090809oss
gmake
cp -Rp include/tbb/ /usr/include/
cp /home/ec2-user/hiphop/tbb22_20090809oss/build/*_release/*.so /usr/lib/
cp /home/ec2-user/hiphop/tbb22_20090809oss/build/*_release/*.so.2 /usr/lib/
ldconfig
cd /home/ec2-user/hiphop/re2c-0.13.5
./configure --prefix=/home/ec2-user/hiphop/local
make install
cd /home/ec2-user/hiphop/libevent-1.4.14-stable
cp /home/ec2-user/hiphop/hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
patch < libevent-1.4.14.fb-changes.diff
./configure --prefix=/home/ec2-user/hiphop/local
make install
cd /home/ec2-user/hiphop/curl-7.20.0
cp /home/ec2-user/hiphop/hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p1 < libcurl.fb-changes.diff
./configure --prefix=/home/ec2-user/hiphop/local
make install
cd /home/ec2-user/hiphop/libmemcached-0.48
./configure --prefix=/home/ec2-user/hiphop/local
make install
cd /home/ec2-user/hiphop/hiphop-php
git submodule init
git submodule update
export HPHP_HOME=/home/ec2-user/hiphop/hiphop-php
export HPHP_LIB=/home/ec2-user/hiphop/hiphop-php/bin
cmake .
make
alias hphp=/home/ec2-user/hiphop/hiphop-php/src/hphp/hphp

然后每次登录SSH时粘贴:


sudo su -
cd /home/ec2-user
export LDFLAGS="$LDFLAGS -lrt"
export CMAKE_PREFIX_PATH=/home/ec2-user/hiphop/local
export HPHP_HOME=/home/ec2-user/hiphop/hiphop-php
export HPHP_LIB=/home/ec2-user/hiphop/hiphop-php/bin
ldconfig
alias hphp=/home/ec2-user/hiphop/hiphop-php/src/hphp/hphp

哦,我应该补充一点,你需要在要运行编译脚本的服务器上安装HipHop.所以考虑到所有这些,它可能不是你想要的.

推荐阅读
周扒pi
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有