kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Moving mod_pagespeed’s file-based cache into RAM

Posted on January 27, 2012

Google's mod_pagespeed does a great job at optimising web resources such as HTML, JS, CSS and even images.
I use it on a lot of customer production sites as a great partner to APC cache for super fast web sites.

I won't go into details on how it works, if you're  reading this, you already know!

mod_pagespeed caches resources to disk. If you are running on a heavily loaded server or a VPS, disk IO is a premium.
So we should really cache to memory, its faster, cheaper and easy to set up.

[Snippet] Setting the timezone for PHP 5.3

Posted on January 25, 2012

PHP 5.3 requires a time zone to be set if you do any kind of date processing.

Simply set this in your php.ini

  1. // London, England, Europe
  2. date.timezone = "Europe/London"
  3. date.default_latitude = 51.500181
  4. date.default_longitude = -0.12619

Salford City Stadium

Posted on January 23, 2012

Taken on a wet and rainy day in Salford, you can see the website for Salford City Stadium advertised from Barton Bridge on the M60.
I was lucky enough to work on the WordPress powered website last year (2011)

 

 

New Client: The Spa @ Dolphin Square – Moroccan Inspired Luxury Spa In London Pimlico

Posted on January 21, 2012

My first MODX site in quite a while. The Spa @ Dolphin Square - Moroccan Inspired Luxury Spa In London Pimlico

 

Working from PSDs I was tasked with turning them into a fully working MODX Revolution CMS. Fully template driven and with everything configurable from MODX to make one highly configurable and visually stunning site.

Tagged as: No Comments

Using Persistent Cache in WordPress (with APC)

Posted on January 9, 2012

Ever since WordPress 2.5, the WP Cache functions haven't been persistent, so the cached objects are only available for the page load (or script run). This means that data stored in the cache resides in memory only and only for the duration of the request.

Upto version 2.5 we could have simply added define('WP_CACHE', true) to the wp-config.php and we got persistent cache features. This is no longer the case and isn't really very well documented.

The later versions need a Persistent Cache Plugin. I'm not a fan of some of the larger caching plugins like W3 Total Cache or WP Super Cache as they tend to add complexity and can cause other problems. Besides, as developers, we're better off writing the code ourselves.

Before going any furuther its probably worth pointing out WordPress has two persistent caching methods.

The first method is the WP Transients API,

The second method is extending the existing WP Object Cache that is currently throughout your WordPress site already.

  • Extending this object is much more flexible
  • Can extend into APC, memcache or similar
  • Provides a fast cache for basic WordPress functions even before you write your own code

MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS

Posted on January 7, 2012

Ignoring all the panic-mongers on the rest of the internet upgrading MySQL from 5.0 or 5.1 to 5.5 shouldn't be that difficult. My task was to upgrade from 5.0 to 5.5 on CentOS (Remi Repos). It was to fix a bug with MySQL 5.0 ignoring the wait_timeout parameter in my.cnf.

Five to five on a Friday, I dive into the swamp, which turns out to be full of alligators.

Alligator 1: Version depenencies
Alligator 2: /usr/libexec/mysqld: unknown option '--skip-locking'
Alligator 3:  [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 481 error messages,
but it should contain at least 641 error messages.
Or some other variation of numbers.

Install the Remi Repo in CentOS

Posted on January 7, 2012

The Remi Repo is a yum repository maintained by a French dude - Remi Collet. It contains much more up to date packages (January 2012) such as MySQL 5.5 and PHP 5.3.

Heres how I installed it on CentOS.

New Site: GamerNode – WordPress Site Migration

Posted on December 21, 2011

I recently had the pleasure of working with a well respected gaming news site - GamerNode.

My challenge was to convert their existing outdated, custom coded CMS (and database) into WordPress.

I did this with a selection of custom scripts and image downloaders to help smoothly migrate from old to new.

Contact me for more information on WordPress Site Migrations.

New Site: HSS Blog

Posted on December 20, 2011

I was recently commissioned to code a new WordPress blog for the national hire company HSS Hire. Their new blog features excellent articles from DIY, gardening and hiring professionals for the job. See http://blog.hss.com/ for the new site.

Tagged as: , 1 Comment

Alternate ‘Messing with time and date on Linux’

Posted on December 20, 2011

Following up from a previous post, some hypervisors like Xen are a bit fruity when trying to control the time via NTP. Here's how we managed it.

Firstly, if your installation doesn't have ntp install. Install that.

  1. yum install ntp
Page 1 of 3412345...102030...Last »