I upgraded tumble*jalada (which is running on a server running Lighttpd) to WordPress 2.7 on release, and everything seemed to be OK – the upgrade was actually very quick and easy. I had set up my WordPress installation to use SVN so it was a one line svn sw command.
However I had a problem, scheduled posts stopped working. I knew from previous problems with scheduled posts that they are produced by wp-cron.php running for requests to the blog and if the time has gone past for the scheduled post to be posted, it causes it to be posted. I took a look in my lighttpd log file, and discovered this error was being produced by wp-cron.php being accessed:
2008-12-16 13:04:56: (request.c.1110) POST-request, but content-length missing -> 411
I looked into the HTTP 411 error and why Lighttpd might cause it to occur when other web servers (presumably) don’t, and discovered a forum thread explaining that Lighttpd is strict about the Content-Length header, and requires it even if the POST-request is empty. So I took a look through the WordPress source. Turns out in wp-includes/http.php when the POST-request is empty it doesn’t send any headers (specifically Content-Length). The fix is simple – I changed the code so that Content-Length is set to 0 when the POST-request is empty.
I submitted it to WordPress Trac, and the fix has been included for 2.7.1 and has been added to the trunk and 2.7 branch. You can apply the fix yourself in the meantime if you are running Lighttpd and WordPress 2.7 – just see the changeset diff in the above links.
This is the first time I’ve contributed to an open source project (albeit a very small contribution), I feel very pleased with myself.





Where’s my threaded comments…
There they are!
Thank you!
One google search leading directly to the solution for my problems.
Thanks so much for this tip — it was exactly what I was looking for.