PHP: Multiple DNS Queries Using fopen

Whilst working on some inherited PHP code that used fopen I noticed an interesting comment in the PHP manual which pointed out that fopen always makes a DNS lookup for every request. Taking the following code as an example: <?php $handle = fopen("http://muffinresearch.co.uk/robots.txt", "r"…

Large Temporary Files Left Behind by ImageMagick

Recently since moving the CSS Sprite Generator to a new server we've had a couple of cases where the site has stopped working due to running out of disk-space. The cause was due to some epic temporary files being left behind by ImageMagick: -rw------- 2.7G Nov 1 10:25…

Python or PHP?

Recently I've been having interesting discussions with Ed and Cyril regarding some of the differences between PHP and Python and what makes each one special. So I'm interested to know what are the things you love about PHP or Python? What features made you choose one over the other? If…

Dvorak's comment spam fix

As a regular listener to This Week In Tech I heard on the latest show John C Dvorak's anti-spam provider Marc Perkel at ctyme.com has come up with a way to prevent comment spam on any site running apache. I went over to John's site to get the low…