This brief tutorial is going to show students and new users an easy way to install and run WordPress with the support of HHVM ( Hip Hop Virtual Machine). HHVM was developed by Facebook to run applications that are based on PHP and the Hack language. Most will agree that HHVM is faster than the traditional PHP stack. So, if you want to improve WordPress’ performance, running it on HHVM, MariaDB and Nginx might help a bit. To get the setup correctly, follow the steps below:
Prepare Ubuntu Server
Before installing packages on Ubuntu systems, you must first update and prepare the machine. Run the commands below to update and remove absolute packages from Ubuntu After running the command above, you may want to reboot depending on what was installed and upgraded.
Installing the Nginx web server
Now that the Ubuntu machine is updated, run the commands below to install Nginx. After installing Nginx, the commands below can be used to stop, start and enable Nginx
Install MariaDB
After installing the Nginx web server, the next step will be to install the MariaDB database server. To do that, run the commands below. After installing MariaDB, the commands below can be used to manage the database server When you’re done running the commands above, run the command below to secure MariaDB and create the root password When prompted, use the guide below to answer the questions
Create WordPress Database
The next step in the process is to create a database and database user for WordPress. To do that, we’re going to create a WordPress database called wpdb and a user called wpuser. To do that, run the command below to logon into the MariaDB server Then run the commands below to create a database called wpdb Next, run the commands below to create a database user called wpuser Grant all privileges to the user to manage wpdb Finally, flush the permission to save your changes
Installing HHVM
To install HHVM on Ubuntu you must add its repository and key. To do that, run the commands below to install the repository’s key. Run the commands below to install the repository After that, run the commands below to install HHVM Nginx, run the commands below to configure HHVM to work with the Nginx web server Run the commands below to make HHVM the default PHP compiler Finally, fun the commands below to start and enable HHVM
Configure Nginx and Install WordPress
Now that all the servers and modules are installed, go and configure Nginx to serve PHP applications. To do that, open the Nginx default site configuration and add an index for PHP. Then add the PHP index. Save the file and you’re done.
Download files
Now that you’ve installed all the servers and packages that WordPress needs, it’s time to download WordPress content. To download the content, run the commands below. Next, extract the downloaded content by running the commands below.
Configure WordPress Site
After extracting WordPress content, the first thing you’ll want to do is delete the Apache default file in its root directory. Next, move WordPress content to Apache2’s root directory by running the commands below. After moving WordPress content to its root directory, use the command below to make a copy of wp-config-sample.php file and name it wp-config.php. The wp-config.php is the default configuration file for WordPress in its root folder. Next, edit wp-config.php file and make the below changes. // ** MySQL settings – You can get this info from your web host ** // /** The name of the database for WordPress / define(‘DB_NAME’, ‘wpdb‘); /* MySQL database username / define(‘DB_USER’, ‘wpuser‘); /* MySQL database password */ define(‘DB_PASSWORD’, ‘new_password_here‘); Save your changes when done. Finally, run the commands below to set the correct files and folder permissions for WordPress to function properly. After all of the above, restart the Apache2 web server.
Start installation
The final step is to open your web browser and browse to the server IP address or hostname. You should be prompted with the WordPress default setup page. If you see this page, then everything went perfectly! Continue with the WordPress setup wizard until you’re done. When you’re done. you’ll have fully installed WordPress on HHVM. Enjoy!