centos6 配置hhvm+php+Nginx+mysql

來源:互聯網
上載者:User

標籤:blog   http   io   ar   os   sp   div   on   2014   

HHVM(HipHop Virtual Machine),Facebook的開源項目之一,用於代替php環境,這裡不多做介紹,本文介紹配置教程.

安裝所需的epel和hhvm yum源

rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
安裝hhvm所需依賴包
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
添加gleez yum源
sudo rpm -Uvh http://yum.gleez.com/6/x86_64/gleez-repo-6-0.el6.noarch.rpm

如果是國內主機,由於gleez.com被牆,這裡提供另外一個

sudo rpm -Uvh http://blog.linuxeye.com/wp-content/uploads/2014/05/gleez-repo-6-0.el6.noarch.rpm
安裝remi yum源
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.5-1.el6.remi.noarch.rpm
從remi安裝hhvm依賴包 , mysql
yum --enablerepo=remi install libwebp mysql mysql-devel mysql-lib
安裝hhvm
yum --nogpgcheck install hhvm
將hhvm加入開機啟動
chkconfig hhvm on

配置hhvm

# vi /etc/hhvm/server.ini

;hhvm.server.port = 9001 (注釋或者刪除此行)hhvm.server.file_socket = /var/run/hhvm/sock (添加此行,hhvm運行模式由連接埠改為socket方式)

# vi /etc/hhvm/php.ini在php options下面追加為以下內容,以添加記憶體限制,關閉expose.

hhvm.mysql.socket =/tmp/mysql.sockmemory_limit = 512Mexpose_php = 0

配置nginx:

找到service欄位內的php部份,此處在每次添加完虛擬機器主機以後都要修改.

fastcgi_pass unix:/tmp/php-cgi.sock; (注釋此行)fastcgi_pass unix:/var/run/hhvm/sock; (添加此行)

如:

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;    }
重啟nginx,啟動hhvm.大功告成.
service nginx restartservice hhvm startservice mysqld start
  • 相關文章推薦:
  • 在centos6.5上安裝redmine 2.53
  • CentOS6安裝tomcat6
  • 在Centos6.3安裝Python Fabric運行環境
  • 本文來自:愛好Linux技術網
  • 本文連結:http://www.ahlinux.com/centos/9090.html
 

centos6 配置hhvm+php+Nginx+mysql

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.