Support » Fixing WordPress » XML-RPC and PHP 5.2.2

  • Hi!
    After having upgraded the server I’m using for my WordPress blog with PHP 5.2.2 it seems that I’m now unable to make any posts using the metaWeblog API. It is working perfectly fine when I use PHP 5.2.1. though so it can’t possibly be my WordPress installation that is the cause of this. (I’m using version 2.1.3)

    Is anyone else on this forum having this problem as well?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is almost certainly the same problem I had here. It turns out there’s a bug in PHP 5.2.2 with the feature WordPress uses to run XMLRPC — which is how all the APIs work.

    In theory, it will be fixed in the next PHP version. For now, I found that you can work around the problem by adding the following line at the beginning of WordPress’ xmlrpc.php:

    $HTTP_RAW_POST_DATA = file_get_contents("php://input");

    Put it right before the first line that mentions $HTTP_RAW_POST_DATA, and it should do the trick.

    That did the trick indeed. Thanks alot for helping me Kelson!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘XML-RPC and PHP 5.2.2’ is closed to new replies.