PHP 5.3.1 now available in WHM/cPanel’s EasyApache

After much patience and persistence on the part of myself and many other individuals, we now have PHP 5.3.x support in EasyApache, starting with PHP 5.3.1.  For those of you who may be unaware, EasyApache is WHM/cPanel’s tool for creating custom compilations of Apache and PHP.  This solves many problems for those who have been doing this “behind the scenes,” as well as those who wish to utilize some of the great new features implemented in the 5.3 series.  PHP 5.3.1 introduces namespaces, late static binding, decreased memory usage (YMMV), several new extensions, and improved MySQL support.  Be sure to check your scripts for compatibility before going live with PHP 5.3.1 on a production server.  Some scripts will be affected by some of the changes, so testing is extremely important.

Using memcached with WordPress

wp-settings.php
wp-settings.php

Today, I decided to implement a popular distributed caching system called memcached.  Memcached allows PHP objects and variables to be stored in memory, which when used properly, can decrease page load time and server load.  Memcached can also work as a central cache for a cluster of servers.  File-based caching systems work by generating static files, and storing them in a local directory to be served in place of the dynamic content.  This can reduce the number of database queries, and help avoid having to process the script with each new request; however, there is a downside. Continue reading Using memcached with WordPress

PHP 5.2.12 released

PHP LogoWe’ve been paying close attention to new PHP releases, with a focus on the 5.3.x series release branch, but an important security update has been made to the 5.2.x branch.  The new max_file_uploads PHP directive will prevent DOS (denial of service) attacks that happen by using file uploads to create temporary file exhaustion.  This is an important one, and should be implemented as soon as possible.  Links to the release announcement, changelog, and download page are listed below.  On a side note, WHM/cPanel has not updated EasyApache yet, but we are assuming this will come soon.  We’ve also gotten word that, due to popular demand (thank you everyone), cPanel is working as fast as possible in getting PHP 5.3.1 into EasyApache (see cPanel forum post for more info: http://bit.ly/931YpZ).

Download PHP 5.2.12

http://www.php.net/releases/5_2_12.php

Generate HTML drop downs from arrays & ranges with a PHP class

There comes a time (or a multitude of times) where a developer finds him- or herself rewriting the same code over and over again. Eventually, we get tired of it and need to find a solution. Recently, I frequently found myself writing code to generate HTML drop downs.  This became tedious, and I started to think it was unnecessary. But wait!  There must be a better way!  I didn’t want to use Zend_Form or any other 3rd party solution; I wanted to create my own class to help take care of this problem.  Below is the code/examples for the class, then a description of some of the methods, and lastly a link to download the source code.  As you can see, there are some nice features, and the class is easy to use and extend. Continue reading Generate HTML drop downs from arrays & ranges with a PHP class