Latest stories

Apache VirtualHost .htaccess issue, Request exceeded the limit of 10 internal redirects, redirected from r->uri…

For some reason (not sure of the exact cause) but .htaccess can cause an internal Apache redirect loop which loops back onto itself before it hits your PHP (or whatever) script In my case it was an issue with VirtualDocumentRoot (not sure if there were too many or what exactly) If you see error_log messages like this… [Wed Jun 13 10:34:35 2012] [error] [client 127.0.0.1] Request exceeded...

Installing XenServer after removing VMWare ESXi “Could not parse sgdisk output”

If you try to install XenServer (and this probably happens with some Linux distros too) after having VMWare ESXi (vSphere Hypervisor) on your server then you’ll likely encounter an error early on in the installation process saying “Could not parse sgdisk” This is related to how VMWare provision the disks for VMFS, as XenServer will error when trying to detect the local disks...

Use Zend_Log_Writer_Firebug to debug AJAX requests using Firebug

Debugging a page request in PHP, simple right? Either output to the page or command-line using something like var_dump, or use a step-through debugger to go through line-by-line. The advantage of the former is that it’s quick, and although the latter is more thorough it can be quite time-consuming. However when you’re debugging an AJAX request, you can’t simply output as...

Using Zend_Db_Profiler_Firebug to show database queries per page

Although ZFDebug is a great tool, it does require you to show the toolbar when you need to check something. Whilst this is fine for developers or administrators, it’ll probably confuse regular users. Therefore if you’re trying to debug something a regular user is doing, you may need another way to see what database queries are being run. Luckily Zend Framework has both a logger and a...

Checking $mixed parameter type for PHP methods

Something that we came across this morning, and something to be wary of in the future, is how you check the parameter type of a $mixed variable in a method signature. i.e. Is the parameter a string or a number? If you’re not careful you can get unexpected results… As we’ve discovered, using ctype functions can be dangerous as ctype_digit() for example expects a string as a...

“concrete5 cannot parse the PATH_INFO or ORIG_PATH_INFO information provided by your server.”

Thought I’d take a look into concrete5 to see what is was like, and it’s the first open source PHP project installer I’ve come across in ages that complained about anything other than filesystem permissions. PATH_INFO? Most other projects use different mechanisms/variables to do a similar job I assume… Anyways, go to the concrete5 install directory and create a .htaccess...

Enable hibernation on HP MicroServer for Windows Home Server v1

Since I got my HP ProLiant MicroServer setup with Windows Home Server v1 (instead of 2011) I haven’t been able to suspend or hibernate it. Whilst I thought this would be a straightforward fix it turns out it can be a bit tricky. Whilst you can enable hibernation it is not possible to enable suspend as the hardware itself does not support it. To go into hibernation, open the command prompt...

VirtualBox Guest Additions with Shared Folders for Linux Virtual Machines on Mac OS X

In order to access certain aspects of a virtual machine in VirtualBox, you will need to install Guest Additions (similar to VMWare Tools I guess) There is a manual page for installing Guest Additions but not all of it is self-explanatory… First you need to log into your Linux virtual machine (VM) and install/configure x, y and z. Install DKMS This part is relatively straightforward, just...

Using PHP late static binding to define static arrays as subsets for child classes

OK, the title might sound a little confusing, but the concept it relatively simple. Basically it’s using an array in a child class that contains some of the items that appear in the array in the parent class. Which just means you have a list of all of the things in the parent, and a list of some of those things in every child. Like a list of options such as colours, types, etc. Imagine that...