XMLRPC Error with Wordpress (SOLUTION)

apps

#1

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:

[code]<?php

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’] =
file_get_contents(“php://input”);
[/code]
And XMLRPC is now working again.

blueorder


#2

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.


#3

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


#4

Couple of things.

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

Regards,

blueorder