CENTOS6 Configuration Hhvm+php+nginx+mysql

Source: Internet
Author: User
Tags hhvm

HHVM (HipHop Virtual machine), one of Facebook's open source projects, is used instead of the PHP environment, which is not much of an introduction here, this article describes the configuration tutorial.

Install the required Epel and HHVM yum sources

RPM-UVH http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
To install the HHVM required dependency package
sudo 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-devel bzip2-devel oniguruma-devel openldap-devel Readline-devel libc-client-devel libcap-devel libevent-devel libcurl-devel libmemcached-devel
Add Gleez Yum Source
sudo rpm-uvh http://yum.gleez.com/6/x86_64/gleez-repo-6-0.el6.noarch.rpm

If it is a domestic host, due to gleez.com by the wall, here to provide another

sudo rpm-uvh http://blog.linuxeye.com/wp-content/uploads/2014/05/gleez-repo-6-0.el6.noarch.rpm
Installing the Remi Yum Source
sudo rpm-uvh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.5-1.el6.remi.noarch.rpm
Install HHVM dependency Package from Remi, MySQL
Yum--enablerepo=remi install libwebp mysql mysql-devel mysql-lib
Installing HHVM
Yum--nogpgcheck Install HHVM
Add HHVM to boot
Chkconfig HHVM on

Configure HHVM

# Vi/etc/hhvm/server.ini

; hhvm.server.port = 9001 (Comment or delete this line) Hhvm.server.file_socket =/var/run/hhvm/sock (Add this line, HHVM run mode changed from port to socket)

# Vi/etc/hhvm/php.ini Append the following to the PHP options to add the memory limit and turn off expose.

Hhvm.mysql.socket =/tmp/mysql.sockmemory_limit = 512mexpose_php = 0

Configure Nginx:

Find the PHP section in the Service field, where you need to modify it every time you add a virtual host.

Fastcgi_pass Unix:/tmp/php-cgi.sock; (Note this line) Fastcgi_pass Unix:/var/run/hhvm/sock; (Add this line)

Such as:

Location ~ \.php{  root  /usr/share/nginx/html;  Fastcgi_pass Unix:/var/run/hhvm/sock;  Fastcgi_split_path_info ^ (. +\.php) (. *) $;  Fastcgi_index  index.php;  Fastcgi_param path_info $fastcgi _path_info;  Fastcgi_param  script_filename  $document _root$fastcgi_script_name;  Fastcgi_param  path_translated $document _root$fastcgi_path_info;  Includefastcgi_params;    }
Restart Nginx, start HHVM.
Service Nginx restartservice HHVM startservice mysqld Start
    • Related articles recommended:
    • Installing Redmine on the centos6.5 2.53
    • CentOS6 installation Tomcat6
    • Installing the Python Fabric runtime environment in Centos6.3
    • This article from: Hobby Linux Technology Network
    • This article link: http://www.ahlinux.com/centos/9090.html

CENTOS6 Configuration Hhvm+php+nginx+mysql

Related Article

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.