Articles

A collection of articles and snippets I've collected over the years.


May 21, 2013

I've been a PHP Web Developer for a long long time and have spent many hours setting up development environments in order to practice my trade. From full blown towers running full cdrom...

May 17, 2013

This morning I had an issue with a PHP imagick ImagickException when converting a PDF/postscript file to a thumbnail. I have PHP Imagick, Imagemagick and Ghostscript installed and everything...

April 10, 2013

Recently I've been experiencing a Magento admin login problem in Chrome. The problem is that when I enter the correct username and password on the Magento admin login screen it simply returns back to...

March 30, 2013

Formula one is the pinnacle of motorport. We know the cars are fast and the pace of development is relentless, but when it comes to performance how do the teams websites compare?

March 25, 2013

Here's how to go about routing requests to index.php with Apache. I'm always having to search for this online so I thought I'd document it here. Many of the 'modern' PHP applications use index.php as...

March 12, 2013

This PHP Snippet caught me out today: Notice the backticks around the array key? These automatically try executing the key as a shell command, in this case, trying to change the password of the...

February 13, 2013

Whilst the LAMP stack is easy to install (sudo tasksel & select 'LAMP'), installing PHP 5.4 and Nginx on Ubuntu 12.04 isn't as straightforward. For a start, the packaged Nginx is out of date and...

January 5, 2013

I regularly use Vim but have to confess that I'm not a 'power' user. To help me learn Vim keyboard shortcuts I have noted them down here.

January 2, 2013

I've just been searching for a way to force a file to download using the Silex PHP framework and didn't find any examples. After reading through the Silex code I worked it out. Here's how to force a...

December 19, 2012

I usually develop on an Ubuntu VM running in VirtualBox but have needed to install PHP and MySQL on OSX Mountain Lion on the MacBook Pro. Here's a Github Gist from Aaron Brady with details on how to...

October 16, 2012

Have you ever been tailing a log file looking for a specific keyword or phrase? Maybe you're tailing an Exim log watching for an email, or an Apache log file for a specific request. Wouldn't it be...

October 15, 2012

This is here for reference as I keep forgetting how to restart apache on Mac OS X Mouintain Lion. Here's how to do it: Enter password and you're done. You can also start and stop Apache by using the...

September 24, 2012

Occasionally I use JQueryUI components to display dialogs and I like to set the cursor to the 'timer' when the event is triggered and back to 'auto' afterwards. Here's how to change the cursor with...

July 25, 2012

If you ever have the need to detect iPad and iPhone with PHP, or any other mobile/tablet device, you can use the excellent php-mobile-detect library available at...

July 11, 2012

Often you will need to know which version of Magento you are running in order to install an extension or apply a security patch. Heres how to find the Magento version you are running. Alternatively,...

June 29, 2012

Nginx by default will only compress text/html content types. Heres how to gzip javascript and css with NGinx: In your nginx.conf file: Or in your sites-enabled site file: Reload nginx and your css...