Run WordPress with HHVM

Source: Internet
Author: User
Tags hhvm
Facebook developed a brand new HipHopVMforPHP (HHVM) based on the previous HPHPc, HPHPi, and HPHPd. the JIT (Just-In-Time) compilation technology can be used to quickly generate code and compile code instantly. According to Facebook, HHVM has more than 5 times the performance of ZendPHP5.2. More importantly, HHVM is open source ~ Run now

Facebook developed a brand new HipHop VM for PHP (HHVM) based on the previous HPHPc, HPHPi, and HPHPd, using JIT (Just-In-Time) compilation technology allows you to quickly generate code and compile code instantly. According to Facebook, the performance of HHVM is more than 5 times that of Zend PHP 5.2. More importantly, HHVM is open source ~ Run now

Facebook developed a brand new HipHop VM for PHP (HHVM) based on the previous HPHPc, HPHPi, and HPHPd, using JIT (Just-In-Time) compilation technology allows you to quickly generate code and compile code instantly. According to Facebook, the performance of HHVM is more than 5 times that of Zend PHP 5.2. More importantly, HHVM is open source ~

Currently, the popular environment for running popular PHP applications such as WordPress/Drupal is Nginx/Apache + MySQL + PHP. Let's see if the HHVM artifact can fix WordPress. HHVM can be used as an independent server and does not need to be used with other web servers.

First, update the system (Ubuntu Server 12.04 LTS version is used here) and upgrade the system, and then install php and mysql (hhvm can run independently without installing apache ):

$ sudo apt-get update && apt-get upgrade$ sudo apt-get install mysql-client mysql-common mysql-server php5 php5-cli php5-common php5-cgi php5-mysql

Add the hiphop source and install hiphop-php after the update:

$ sudo echo "deb http://dl.hiphop-php.com/ubuntu precise main" >> /etc/apt/sources.list$ sudo apt-get update$ sudo apt-get install hiphop-php

Create the database required by wordpress:

$ mysql -uroot -prootmysql> create database wordpress;mysql> Bye

Download wordpress, decompress it, and modify the configuration file to connect to the database:

$ cd /var/www$ sudo wget http://wordpress.org/latest.tar.gz$ sudo tar -zxf latest.tar.gz$ sudo chown -R www-data:www-data wordpress$ cd wordpress$ sudo cp wp-config-sample.php wp-config.php$ sudo vi wp-config.php.../** The name of the database for WordPress */define('DB_NAME', 'wordpress');/** MySQL database username */define('DB_USER', 'root');/** MySQL database password */define('DB_PASSWORD', 'root');...

Modify wp-db.php:

$ sudo vi wp-includes/wp-db.php.../** * @since 0.71 *///define( 'OBJECT', 'OBJECT', true );define( 'OBJECT', 'OBJECT' );define( 'Object', 'OBJECT' );define( 'object', 'OBJECT' );...

Configure hhvm (just add a configuration file ):

$ sudo vi /etc/hhvm.hdfServer {  Port = 80  SourceRoot = /var/www/}Eval {  Jit = true}Log {  Level = Error  UseLogFile = true  File = /var/log/hhvm/error.log  Access {    * {      File = /var/log/hhvm/access.log      Format = %h %l %u %t \"%r\" %>s %b    }  }}VirtualHost {  * {    Pattern = .*    RewriteRules {      dirindex {        pattern = ^/(.*)/$        to = $1/index.php        qsa = true      }    }  }}StaticFile {  FilesMatch {    * {      pattern = .*\.(dll|exe)      headers {        * = Content-Disposition: attachment      }    }  }  Extensions {    css = text/css    gif = image/gif    html = text/html    jpe = image/jpeg    jpeg = image/jpeg    jpg = image/jpeg    png = image/png    tif = image/tiff    tiff = image/tiff    txt = text/plain  }}

Create the log directory required to run hhvm and run hhvm:

$ sudo mkdir /var/log/hhvm/$ sudo /usr/bin/hhvm --mode daemon --user www-data --config /etc/hhvm.hdf

Visit http: // IP address/wordpress/in a browser and you will be able to see the wordpress installation interface. Follow the prompts to use it after installation to see what is wrong. At the same time, check the hhvm log to see if there are access records:

$ sudo tail /var/log/hhvm/access.log

Original article address: Run WordPress with HHVM. Thank you for sharing it.

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.