FeaturesWP CloudPricingEE CLIContactMy Account
Features
Team Access & User Permissions
Install
Resources
Community
CLEAR
Tutorials
PHP
Using HHVM with PHP-FPM Fallback
Topics
On this page
-
- Getting Started
- Git and File-System Layout (non-default setup)
- Version Constraints
- Managing Themes and Plugins (for entire WordPress site)
- Updating Themes and Plugins (for entire WordPress site)
- Adding Composer Support to Your Own Themes and Plugins (for developers)
- Using Composer to Manage Own Theme/Plugin Dependencies (for developers)
-
- Assigning Multiple IP Addresses to Single LAN Card
- Disable IPv6 on Ubuntu 12.04
- dsh – distributed shell
- fdupes – find & replace duplicate files with hardlinks
- GPG Keys Cheatsheet
- Increase "Open Files Limit"
- kill all php, nginx, mysql or any kind of processes
- Passwordless Authentication for SSH
- Screen
- search replace in multiple files useing grep xargs sed
- Setup sftp
- sysctl.conf
- Timezone Sync
- Using Google Public DNS on Ubuntu Server
- Using openssl to match private key, cerificate and CSR
- Configure Postfix to Use Gmail SMTP on Ubuntu
- Logrotate Example for Custom Logs
- PHP 5.5, MySQL, Postfix, Nginx and WordPress on Ubuntu
- Serverdensity
- Upgrade Ubuntu 10.04 to 12.04
- Using find and sed to replace strings in multiple files
- Webmin
-
- .my.cnf – mysql user & password
- Analyse slow-query-log using Anemometer
- Improving MySQL Query Cache
- MySQL Query Profiling
- Reset MySQL root password
- tuning-primer.sh – an alternative for mysqltuner
- Using MariaDB 10
- Install/Upgrade to MySQL 5.6 on Ubuntu 12.04 LTS
- Change WordPress Domain Name
- Character Sets and Collations
- Enable innodb_file_per_table
- Enable Remote Access (Grant)
- Installing Percona Toolkit
- Using tmpfs for temporary folder creation
- YARPP and InnoDB
- Convert MyISAM to InnoDB
- Using tmpfs for mysqldump & mysqlimport
- Convert from INNODB to MYISAM
- Analyse slow-query-log using mysqldumpslow & pt-query-digest
- mysqlcheck with cron to optimize automatically
- Using MySQLTuner to Optimize MySQL configuration
-
-
- Directly connect to PHP-FPM
- Generating core-dump for php5-fpm
- GeoIP
- Having php5 and php7 on same system.
- Install Xdebug and configure it with webgrind
- Installation of PHP Code Review Tools
- memcache
- PHP's Zend Opcache Config & Web Viewer
- Setting Sqlite support with PHP
- Using HHVM with PHP-FPM Fallback
- Using Redis for PHP Sessions on Ubuntu Server
- Installing PhpMyAdmin Quickly
- Moving PHP's session storage to tmpfs
- Install Xdebug and configure it with Netbeans
- Nginx – Enable PHP-FPM Status Page
- PHP-FPM: Socket vs TCP/IP and sysctl tweaking
- APC Cache Optimization & Monitoring Using Web Interface
- Checking if PHP/WordPress can send mails
- Debugging PHP Scripts Using slow_log and more
- Increase file upload size limit in PHP-Nginx
- Increase PHP script execution time with Nginx
-
- Performance Optimization
- Remove Query string of css/js files
- Setup ElasticSearch with ElasticPress
- Using Redis for WordPress Object-Cache
- WooCommerce Window Shopping Caching Technique
- Moving WordPress To New Server (Faster)
- Better wp-cron using linux's crontab
- 404 error- Page not Found!!!
- Debugging WordPress with Nginx
Installation of HHVM:
Post installation:
Configuring HHVM:
Editing server.ini:
Editing php.ini
Editing hhvm.conf:
Configuring FastCGI:
Use HHVM and adding PHP5-FPM as fallback:
Restart Services:
Testing:
Log File:
Using HHVM with PHP-FPM Fallback
Note: HHVM doesn’t play with all WordPress themes and plugins. Test your site properly before using this in production.
Installation of HHVM:
For installation of HHVM please follow this guide:
https://github.com/facebook/hhvm/wiki/Prebuilt%20Packages%20for%20HHVM
Post installation:
We need to configure our web server to use HHVM,
sudo /usr/share/hhvm/install_fastcgi.sh
You can ignore the WARNING from following message.
# sudo /usr/share/hhvm/install_fastcgi.sh
Checking if Apache is installed
WARNING: Couldn't find Apache2 configuration paths, not configuring
Checking if Nginx is installed
Detected Nginx installation
Checking for custom Nginx configuration
WARNING: Detected clashing configuration. Look at /etc/nginx/hhvm.conf for information how to connect to the hhvm fastcgi instance.
#
Configuring HHVM:
Editing server.ini:
Open server.ini file:
vim /etc/hhvm/server.ini
If HHVM crashed then site must use PHP-FPM as fallback, so change HHVM server port from 9000 to 8000
hhvm.server.port = 8000
Editing php.ini
Open php.ini file:
vim /etc/hhvm/php.ini
Add following towards end of file:
hhvm.log.header = true
hhvm.log.natives_stack_trace = true
Editing hhvm.conf:
Note: This editing is not required, as we are not using this file, but if have included hhvm.conf in your previous site then you also need to change HHVM port here.
vim /etc/nginx/hhvm.conf
and change HHVM port from 9000 to 8000:
fastcgi_pass 127.0.0.1:8000;
Configuring FastCGI:
Open fastcgi.conf file:
vim /etc/nginx/conf.d/fastcgi.conf
and add following line towards end of file:
fastcgi_keep_conn on;
Use HHVM and adding PHP5-FPM as fallback:
Open Upstream.conf file:
vim /etc/nginx/conf.d/upstream.conf
and make sure it look like this:
# Common upstream settings
upstream php {
# server unix:/run/php5-fpm.sock;
server 127.0.0.1:8000;
server 127.0.0.1:9000 backup;
}
upstream debug {
# Debug Pool
server 127.0.0.1:9001;
}
Restart Services:
service hhvm restart
php5-fpm -t && service php5-fpm restart
nginx -t && service nginx restart
Testing:
- Using web browser:
Just point your browser to https://example.com:22222/php/info.php, if you are seeingHipHopthen, your server is using HHVM, otherwise it is using FPM - Using CURL:
Use following command to test from command line:
curl -I example.com
If you are able to see line like this:
X-Powered-By: HHVM/3.2.0
then your site is using HHVM, otherwise FPM
Log File:
You should check the HHVM error log file for any issues related to your site.
tail -f /var/log/hhvm/error.log
- We also like to know to your experience for HHVM with EE, for that you can comment here: #180
- If your configuration is better that us or you feel like we are missing something you can use our HHVM support checklist #199
Setting Sqlite support with PHP
PREVIOUS
Using Redis for PHP Sessions on Ubuntu Server
NEXT
Features
- Server Setup & Management
- Site Creation & Management
- Create WP Cloud Sites
- Speed & Caching
- Firewall Protection
- Backups & Recovery
- Logs & Monitoring
- Deployments & Developer Tools
- Team Access & User Permissions
Useful Links
Product
Other Products
Subscribe for curated product updates, tips, and announcements.
"*" indicates required fields
This field is for validation purposes and should be left unchanged.
Email*
SIGN ME UP
Δ
© rtCamp, since 2009. All rights reserved.