Forums

XMLRPC - Garbage Characters before <XML> node?? (7 posts)

  1. chrisemersonnc
    Member
    Posted 4 months ago #

    I know there are a bunch of XMLRPC threads. I've searched through 8 (pages) or so and haven't seen anyone reporting this particular issue so here I am starting a new post.

    I like many folks want to use Live Writer to make posts to my local wordpress server. But like many others my xmlrpc.php isn't working correctly.

    Here's my problem simplified into a screenshot:
    http://img232.imageshack.us/img232/2109/xmlrpcgarbage20090720m.png
    (Generated using http://gggeek.raprap.it/debugger/)

    For whatever reason, my xmlrpc.php file is including a few garbage characters before the <XML> node in xmlrpc's response (see screenshot). As you can see, the xmlrpc is reporting the right info - but the garbage characters are causing Live Writer to assume an invalid server response.

    I have scoured the net for days for solutions and have tried many things including:
    - remove newlines from your .php files
    - disable all plugins
    - change your theme
    - include code in the xmlphp.php itself, etc

    ...But NONE of these things fixes my problem - the garbage characters won't go away!

    My system specs are in the screenshot but here they are in text format:

    - IIS6/Win2k3
    - FastCGI for IIS6 1.5 RC
    - PHP 5.3.0
    - Wordpress 2.8.2

    HUGE thanks in advance to anyone who can help at all!

    - Chris

    PS: If there is already a thread about this feel free to move this post there for me..

  2. josephscott
    Member
    Posted 4 months ago #

    These are probably a Byte Order Mark (BOM). Here's a post that I found that describes this:

    http://www.jasonwoodcock.biz/2008/10/08/wordpress-a-byte-order-mark-found-in-utf-8-file-warning/

    So either edit them out (very carefully) or you could try downloading a fresh copy of the xmlrpc.php file for 2.8.2 from Trac - http://core.trac.wordpress.org/browser/tags/2.8.2/xmlrpc.php?format=txt

  3. chrisemersonnc
    Member
    Posted 4 months ago #

    Thank you for your suggesting Joseph.

    I followed the instructions of the 1st link you posted and using the same Hex editor as in the link I removed the leading garbage (BOM) characters from *every* php/css file in the following locations:
    - Wordpress root folder
    - wp-includes folder
    - my selected theme folder

    At this point I re-tested with the XMLRPC debugger and noted that my garbage (BOM) character count had gone from 9 to 3 - but not gone completely.
    http://img517.imageshack.us/img517/7969/xmlrpcgarbage20090721.png

    Then I tried disabling all my plugins (rather than open all plugin php files in hex editor). I retested with the debugger and saw the following:
    http://img132.imageshack.us/img132/8953/xmlrpcgarbage20090721b.png

    Holy cow all the garbage (BOM) characters were gone!

    At this point it was just a process of elimination to find which plugin was causing those 3 garbage (BOM) characters. It ended up being [AJAXed Wordpress 1.28]. So I kept that plugin disabled and now my XMLRPC works perfect!

    I have to say this was quite a tedious process and I sure hope something can be done in future to make it not so painful for people like me (Windows/IIS users?) to deal with. But in any case - a HUGE thank you to you Joseph! I love you man!!

    - Chris

  4. Emmadw
    Member
    Posted 4 months ago #

    I've just found this thread & am trying to decide if I have the same problem, or another one.
    From what I can tell, most folks have the problem that Live Writer won't even connect to the blog. Is that right? I've had no difficulties getting to the blog ( http://wordpress.org/support/topic/291727?replies=3 ) - but I have had extraneous characters from the formatting (e.g. /p) creeping in.

    I've tried disabling the plugins, but that didn't work.

  5. josephscott
    Member
    Posted 4 months ago #

    @chrisemersonnc -
    Good to hear you were able to pin it down to a plugin. What I suspect is that the plugin has one or more files with a BOM. That gets added to the every XML-RPC response and causes the breakage. Have you contacted the plugin author to let him know about what you found?

    @Emmadw -
    If you are seeing stripped brackets from HTML then you probably have this-
    http://josephscott.org/archives/2009/03/conclusion-of-libxml2-issues-use-php-529-libxml2-273/
    There is a plugin to help work around this -
    http://josephscott.org/code/wordpress/plugin-libxml2-fix/

    The bottom line though is that your server is using a combination of PHP & libxml that is known to be broken.

  6. chrisemersonnc
    Member
    Posted 4 months ago #

    Hrmm - I thought if I was using anything above php 5.2 I'd be safe from the "bad combination" dilemma - guess I should go back and read those threads to confirm what versions I"m using.

    Still can't thank you enough Joseph - such a world of difference now being able to use Live Writer to post to the blog.

  7. josephscott
    Member
    Posted 4 months ago #

    All of the reports I've seen of BOM problems have been on Windows servers. Seems like a text editor on Windows will inject a BOM when editing files. I'm not yet sure what conditions trigger this.

Reply

You must log in to post.

About this Topic