PHP/MySQL-driven development, Windows 7, JavaScript
Tips for reducing repetitive stress injuries as a programmer
Jan 24th
RSIs, or repetitive stress injuries, can spell doomsday for a programmer or web developer. It’s what many of us fear the most; after all, it’s our life’s work, our passion, our love. I think it is safe to say that pretty much every programmer has felt wrist pain at one time or another. Many times, it goes ignored, which only worsens the problem. There is a lot of research in this area, and as a result there are many preventative measures that can be taken to prevent RSIs. Read the rest of this entry »
Optimize PHP, Apache & MySQL for performance
Jan 21st
Two MySQL tuner scripts
MySQLTuner (Perl) and MySQL Performance Tuning Primer (Shell) are two scripts that can help diagnose MySQL database performance issues, and provide recommendations on how to solve them. While both scripts output similar information, the diagnosis can be slightly different with each script, so I like to use both. Below are directions on how to use them, as well as a few screenshots.
# Download MySQLTuner and MySQL Performance Tuning Primer to ~/scripts. # To avoid having to invoke Perl/SH each time, make both files executable. chmod +x ~/scripts/mysqltuner.pl chmod +x ~/scripts/tuning-primer.sh # After that, give them a go! ~/scripts/mysqltuner.pl ~/scripts/tuning-primer.sh
Major improvements in TPC! Memory Usage for WordPress
Jan 6th
Over the past few weeks, I’ve been actively developing some long-awaited TPC! Memory Usage features. The highlights of the latest release are listed below. I believe that these will help WordPress developers and administrators improve scalability and performance of their blogs and custom applications.
- Custom checkpoints allow administrators to measure memory usage anywhere a WordPress action is available.
- Optional file logging allows administrators to have an effective way of tracking memory usage.
- Improved Security Check, and listed additional variables in System Overview.
- Fixed various bugs (special thanks to those who have taken the time to report issues).
As we continue to improve TPC! Memory Usage and implement new features, we would love to hear your thoughts. Feel free to leave a message on the official TPC! Memory Usage page. As always, thank you for your continued support.
Download TPC! Memory Usage
PHP 5.3.1 now available in WHM/cPanel’s EasyApache
Dec 26th
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.
- Additional information can be found at the link below (several plugins are no longer supported, Zend Optimizer compatibility, etc.):
- All the correspondence leading up to this beautiful moment:
Using memcached with WordPress
Dec 20th
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. Read the rest of this entry »
PHP 5.2.12 released
Dec 17th
We’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
Generate HTML drop downs from arrays & ranges with a PHP class
Dec 1st
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. Read the rest of this entry »
PHP 5.3.1 is finally here!
Nov 19th
After four release candidates, we finally have a stable PHP 5.3.1 release. For those already running PHP 5.3.0, there’s not much that is different, but there are some improvements. For others, it means there will probably be PHP 5.3 support in cPanel/WHM via EasyApache very soon.
In PHP 5.3.1, the max_file_uploads directive was introduced into php.ini to help prevent DOS (denial of service) attacks via file exhaustion. max_file_uploads is set at 20 by default. There were also several other security issues patches, and many bugs fixed in this release. Links containing additional details are below:
Windows Experience Index assessment details in XML format
Nov 18th
Since coming from Windows XP to Windows 7 (skipping Vista), I’ve come to love all of its new features, including the Windows Experience Index. For those who are not aware, the Windows Experience Index is a score based on the performance of the CPU, RAM, graphics, gaming graphics, and the hard drive. Microsoft touts it as a way to see how floor computer models match up against one another, specifically to be used when buying a new computer. In addition, the Windows Experience Index can be used to do more than just calculate a score. In fact, detailed results are constructed in XML format, and saved within a directory on your computer.
Windows 7 Cheat Sheet (Shortcuts/Hotkeys, Reference, etc.)
Nov 16th
Just moments ago, I finished creating a Windows 7 reference card or cheat sheet (whichever you prefer), which includes various hotkeys/shortcuts, as well as general information on Windows Flip 3D, Windows Aero, Windows Snap, and Windows Peek. See below for the download link (4-page PDF).
Download the Windows 7 Cheat Sheet (PDF)



