Archive for the ‘Development’ Category.

WordPress wp-cron not working?

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.

PHP mail() with Ubuntu Desktop and Gmail

Recently I was adapting a newsletter plugin for WordPress and needed the PHP mail() function for testing. However an Ubuntu desktop install is missing Sendmail – the MTA that PHP expects to find on a Linux PC.

I use a local Apache/MySQL server on a laptop to do a lot of my development – I don’t need a full mail server just to send mail.

Also SMTP servers on dynamically assigned IP addresses are so untrusted these days that you can be pretty much guaranteed that a decent spam filter will reject your email based on a RBL lookup. By using Google Mail’s authenticated SMTP service you bypass this restriction.

The lightweight solution is ssmtp.
Continue reading ‘PHP mail() with Ubuntu Desktop and Gmail’ »