The conventional wisdom always said that PHP’s include()/require() was quicker than include_once()/require_once(), but recently I came across an interesting post by Arin Sarkissian which suggests otherwise.
Also I found more commentary on the performance benefit of using relative versus absolute paths in include()/require() and include_once()/require_once() statements (although the main article’s conclusions contradict Arin’s experiments). The Drupal developers discussed and benchmarked the relative/absolute include() issue too.
So in keeping with the spirit of quick and dirty experimentation I hacked up some code and ran some tests on include()/require() against include_once()/require_once() and on the relative/absolute path issue. The results are pretty surprising and I love to hear some views.
Continue reading ‘PHP: The include() include_once() performance debate’ »
The symptom
You cease your contract with your hosting company, cancel your contract and move your web site. People start to complain that they cannot reach your web site. Nothing seems out of order.
The problem:
You were hosting with a major ISP (like Eircom, Magnet or BT Ireland). They put DNS entries into their servers for your web site. When you cancel your contract they should remove these entries. Magnet and BT Ireland are two companies that are negligent in this regard. If they don’t remove these DNS entries, then their customers can have problems reaching your new web site.
Continue reading ‘Beware: ISP’s as Hosting Companies – watch your DNS’ »
Very useful if you run as a ‘restricted user’ (i.e. not a ‘power user’ or ‘administrator’):
Step 1: Get a CMD shell (‘DOS box’) as Administrator:
runas /user:administrator cmd
You will be asked for the Administrator password.
Continue reading ‘Using Runas to Add/Remove Programs/Hardware in Windows XP’ »
Symptom:
- An XML file saved as something.php.html
- Apache was trying to parse it as PHP and throwing an error because Short_open_tag was ‘on’
Fix:
Add the following to an .htaccess file in the folder (or a parent folder):
php_value short_open_tag off
I don’t know if this is a ‘bug’ or a ‘feature’. I don’t see why Apache should be interpreting *.php.html [...]
Continue reading ‘PHP Parse error: syntax error, unexpected T_STRING in /whatever/my-php-class.php.html on line 1 with PhpDocumentor files on CentOS’ »
Moving email servers has always been a royal pain for me. I’ve tried many of them over the years, and migrated from nearly as many of them. However the last couple of times I put myself through the pain I came across imapsync – an excellent script that will do an IMAP to IMAP migration [...]
Continue reading ‘Migrating IMAP Email The Easy Way’ »
Email by IMAP rocks – there are so many benefits to using it over POP3, particularly in an office environment. However many IMAP clients really suck when it comes to manipulating accounts with large messages. We recently watched a server brought to it’s knees during a email server migration – by an 165MB email containing [...]
Continue reading ‘Debug your IMAP server with Telnet’ »