XMLRPC Error with Wordpress (SOLUTION)

I’m posting this just in case someone else has an problem with this. Let someone else benefit from my digging around.

If you are having problems posting through XMLRPC, the problem resides with PHP. There is a known bug in PHP 5.2.2 where HTTP_RAW_POST_DATA fails to ever be set.

The solution, for now, is to 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");
The beginning of my xmlrpc.php file looks like this:


define(‘XMLRPC_REQUEST’, true);

// Some browser-embedded clients send cookies. We don’t want them.
$_COOKIE = array();

if (phpversion()==“5.2.2”) $GLOBALS[‘HTTP_RAW_POST_DATA’] =
And XMLRPC is now working again.


Thank you so much for this. I was so frustrated before I found this. I modified my xmlrpc.php file, and now everything works again.

So this does not seem to be working for me. Any additional suggestions? Thanks!

Couple of things.

What version of Wordpress are you running?
What version of PHP?