There are various reasons why wp-cron does not work, one of the most common ones being a misconfigured network or firewall.
However, due to the way wp-cron works, anything that prevents WordPress opening a http connection to itself will cause wp-cron to fail. In my case I had a .htaccess password set on the development site to prevent crawlers from indexing it.
A quick test to see if WordPress will be able to access wp-cron.php is to use wget from the command line of your server:
1
| wget http://www.example.com/ |
If this fails you will at least have a clue as to why it failed. It would be great if WordPress could log the failure rather than remaining silent (even with WP_DEBUG enabled). This was discussed in http://core.trac.wordpress.org/ticket/11831.
not working for you?
To force a shutdown:
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
And for a reboot:
echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger
Thanks to Nasser Heidari for the tip.
You would think that many of your worries are reduced when you move from shared web hosting to a virtual private server (VPS) but as my experiences testify, there is are some pretty frightening stories out there.
I have dealt with 3 VPS providers in the past year and this post goes through some of my experiences and offers some advice on what to consider when you are weighing up your options.
Not all VPS providers are created equal!
Continue reading ‘Choosing a VPS Web Hosting Provider’ »

Updated with more tests on 2010-05-16.
Click here to jump to the 2010-05-16 update…
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
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 files as PHP (BAD Apache) but now that the issue is fixed for me I am not too concerned.
Update: 2010-05-07:
Kae Varens already came across this and blogged about it in October 2008. It turns out that
- it’s Apache – not me!
- there is a lot more to this than meets the eye
If you manage your own Apache web server then Kae’s blog post is required reading.
There are lots of examples and tutorials covering Apache and mod_rewrite, but generally they address the problem where you want to map a ‘nice’ url to your script. For example:
http://example.com/products/kitchen/cutlery
to
http://example.com/products.php?category=kitchen&sub-category=cutlery
is easily achieved with the following .htaccess rules:
RewriteRule ^([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/? /one.php?action=$1&category=$2&subcategory=$3 [L]
However if you want to rewrite in the other direction it might not be immediately obvious that you cannot use rewrite rules with your GET URL variables. So if you want to go from
http://example.com/products.php?category=kitchen&sub-category=cutlery
to
http://example.com/products/kitchen/cutlery
you need to sniff the query variables as well as the script name.
Continue reading ‘Using Apache mod_rewrite to redirect old URLs’ »
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 wedding pictures that someone had decided to forward throughout the network!
At that stage you are better off talking directly to your email server with Telnet.
Continue reading ‘Debug your IMAP server with Telnet’ »