Subscribe to our RSS feed!

PHP 5.2.2 Breaks XML-RPC In WordPress

If you use an offline blog editor like ecto or BlogJet, and the server hosting your WordPress blog uses PHP version 5.2.2, you might encounter the problem I have for the past 24 hours.

What happened was that every time I wanted to publish a post to this WordPress blog from BlogJet, I'd get an error message with this text:

Invalid payload received from xmlrpc server.

Server said:

"XML-RPC accepts POST requests only."
Nothing has changed with any file in my WordPress installation nor with anything in the blog configuration at my end. All I could think of was that something had changed on the server during the past 24 hours. So I filed a support ticket with DreamHost.

Then I noticed that the PHP version on my server is reporting itself as 5.2.2. The last time I looked, a week or so ago, I'm certain it said 5.2.1. So it appears that DreamHost upgraded PHP.

Anyway, a quick Google search on the phrase "XML-RPC accepts POST requests only" turned up this solution by FolioVision:
[…] edit the xmlrpc.php file in your Wordpress installation and add the following code:

if (phpversion()=="5.2.2") $GLOBALS['HTTP_RAW_POST_DATA'] =

file_get_contents("php://input");
I edited my xmlrpc.php file as suggested - and it works.

Very frustrating if you encounter this problem. Thanks to bloggers like our friend at FolioVision, it's fixable for WordPress blogs.

This could also explain why I received an XML-RPC error when I installed the new version of Windows Live Writer this morning and tried to configure the blog settings. Need to try that one again…

Comments

Bookmark and Share

About the author:
Neville Hobson is the author of the popular NevilleHobson.com blog which focuses on business communication and technology.

Neville is a UK-based communicator, blogger and podcaster. He helps companies use effective communication to achieve their business goals. Visit Neville Hobson's blog: NevilleHobson.com.
Get Your Site Submitted for Free in the World's Largest B2B Directory!

*Mandatory Field
* *

PHP 5 2 2 Breaks XML RPC In WordPress