Skip to content

Instantly share code, notes, and snippets.

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@zackkatz
zackkatz / gf-salesforce-web-to-lead-datetime.php
Last active May 23, 2016 21:04
Use DateTime for Gravity Forms Salesforce Web-to-Lead Addon
<?php
/**
* 1. Tell the plugin to use DateTime instead of Date for the "MyPrefix__Date_and_Time__c" field
*
* @param string $boolean Whether to use DateTime instead of Date (default: false)
* @param string $key The Field Name (or API Name if a custom field) used in Salesforce
* @param array $additional_info Associative array with form, entry, field, feed data
*/
function modify_gf_salesforce_use_datetime( $boolean = false, $key = '', $additional_info = array() ) {

These are the default titles & descriptions I use when using the Local SEO plugin. Note this is only available and used when doing multiple locations.

#####Yoast Local SEO CPT (Default CPT Name is Locations)

Title: %%title%% %%sep%% %%cf__wpseo_business_address%% %%cf__wpseo_business_city%%, %%cf__wpseo_business_state%% %%cf__wpseo_business_zipcode%% %%cf__wpseo_business_country%% %%sep%% %%pt_single%% %%sep%% %%sitename%%

Description: %%excerpt%%

#####Yoast Local SEO CPT Archive Page (Default CPT Name is Locations)

@tomazzaman
tomazzaman / hhvm.conf
Last active May 13, 2021 19:44
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@aeakett
aeakett / find_dupe_ids
Last active August 29, 2015 14:13
Find duplicate IDs in an HTML file
grep -Ho 'id="[^"]*"' <FILE NAME GOES HERE>|sort|uniq -d
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://www.webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility
<?php
/*
Plugin Name: Pagely Force SSL/HTTPS (for WP Engine)
Author: TourKick (Clifford P)
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Plugin URI: http://www.pagelinestheme.com/pagelines-dms-ssl-https/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Description: Force Pagely DMS SSL/HTTPS. <a href="http://www.pagelinestheme.com/pagelines-dms-ssl-https/" target="_blank">http://www.pagelinestheme.com/pagelines-dms-ssl-https/</a> may also be helpful.
License: GPLv2
Version: 1.2
*/
@NateWr
NateWr / rtbbp-address-tag-for-rtb.php
Created November 24, 2014 16:42
Add a notification tag to Restaurant Reservations that pulls the address and directions link from Business Profile
<?php
/**
* Plugin Name: Address Notification Tag for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Add a template tag for notification requests that will print a business's address and a link to get directions from Google.
* Version: 1.0
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@tegansnyder
tegansnyder / hhvm_magento_setup.md
Last active July 14, 2023 22:30
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests