CentOS6.2 try PHP HHVM

Source: Internet
Author: User
Tags hhvm

Introduction to HHVM

Http://en.wikipedia.org/wiki/HipHop_Virtual_Machine

http://www.hhvm.com/

Https://github.com/facebook/hhvm

Installing on the CentOS6.2

Currently, Linux support for Ubuntu, Debian, etc. is in place (Https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM).

You can install the a prebuilt package or compile from source.

in fact, RPM package installation is already very troublesome, the source code compilation is more hurt (can refer to: http://www.xuebuyuan.com/642409.html), so it is better to configure Yum.

1. Add the appropriate source
  cd/etc/Yumrepos.d/  wget http://Www.hop5.in/yum/el6/hop5.repo  Yum makecache

note, do not conflict with your current repo source, especially some common packages, so just choose one at a time.

2. Pre-installed partial dependencies

Don't rush to install HHVM, you'll find a bunch of dependencies. So we need yum install or RPM to manually install the following packages.

Upgrade GCC to 4.6

Yum Install gcc. x86_64-setopt=protected_multilib=false

Install some dependencies

Yum Install libmcrypt-devel glog-devel jemalloc-devel tbb-devel libdwarf-devel mysql-devel libxml2- Devel libicu-devel pcre-devel gd-devel boost-devel sqlite-devel pam-bzip2-devel oniguruma-devel Openldap-devel readline-devel libc-client-devel libcap-devel libevent-devel libcurl-devel Libmemcached-devel

Some versions of the package, the CentOS counterpart is not in the source, especially imagemagick related stuff.

So the following packages are installed separately, there may be some conflict prompts, we directly RPM-IVH--replacefiles *.rpm

Fftw-3.2.1-3.1.el6.x86_64.rpmlibjpeg-turbo-1.2.1-3.el6_5.x86_64.rpmlibmcrypt-2.5.8-9.el6.x86_64. rpmzlib-1.2.3-29.el6.x86_64.rpmlibjpeg-6b-38.x86_64.rpmliblcms2-2.4-1.el6.x86_64.rpmxz-5.2.1

At this point, you can perform the Ultimate boss command:

Yum Install HHVM

The results are as follows:

Look at the relevant command line:

2. Run HHVM

Write a PHP script that we will run in multiple modes

<? PHP Echo "Hello world\n"; Phpinfo ();
1. Command line run under 2. Server mode

HHVM Install the default configuration under/etc/hhvm/, the default is SERVER.HDF, and php.ini.

Here we modify the next SERVER.HDF, as follows:

Pidfile = /var/run/hhvm/pidserver {  = 9090  = /data/lebyzhao/test/  =  Test.php}log {  = Warning  = true  = 8191  = true  = false  = /data/log/hhvm/error.log  Access {    * {      = /data/log/ Hhvm/access.log      =%h%l%u% t \ "%r\" %>s%b    }  }}repo {central  {    = /va R/LOG/HHVM/.HHVM.HHBC  }}# The following content omitted ...

Execute/ETC/INIT.D/HHVM Start,

Note: This is a wrapper script that is actually executed: HHVM--mode server--user root--CONFIG/ETC/HHVM/SERVER.HDF, the configuration inside the HDF can be written directly at the command line: HHVM--mode server-vserver.type=fastcgi-vserver.port=9090

OK, this is the readiness for a pattern similar to fastcgi.

2. Access from Nginx

Here we modify the existing Nginx fastcgi configuration so that it can be forwarded to the HHVM server.

Location         ~. *\.php$ {                include fastcgi.conf;                 proxy_set_header x-real-ip $remote _addr;                Proxy_pass http://localhost:9090;        }

Test a piece from the Nginx:

Basically you can work, and then focus on the configuration of PHP itself. (TODO)

---------

Http://www.tuicool.com/articles/uaqYFr

CentOS6.2 try PHP HHVM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.