fixed

WordPress MU/MS Empty Header and Broken Image Bug Fixed

I just switched to a new server and found myself struggling with empty HTTP headers and broken or partial images. The problem is the memcache extension for PHP and WordPress MU/WordPress multisite’s need to reinstantiate the wp-cache after determining the correct blog for a given request.

Versions of the memcache extension prior to 3.0 go wrong somehow and it shows up when you try to do an HTTP HEAD request on a page (the result is empty) or enable X-SendFile support for WP MU/MS’ file handling (all the files and images in the media library will break). Upgrading to the the 3.x version (in beta since 2007) fixes the problem.

You may have to uninstall the old version before installing the beta, and installing the beta via PECL requires adding “-beta” to the package name. Here are the commands:

pecl uninstall memcache
pecl install memcache-beta

PHP5’s SimpleXML Now Passes CDATA Content

I didn’t hear big announcement of it, but [deep in the docs][1] (? PHP 5.1.0) you’ll find a note about [additional Libxml parameters][2]. In there you’ll learn about “LIBXML_NOCDATA,” and it works like this:

simplexml_load_string($xmlraw, ‘SimpleXMLElement’, LIBXML_NOCDATA);


Without that option (and with all previous versions of PHP/SimpleXML), SimpleXML just ignores any < ![CDATA[...]]> ‘escaped’ content, such as you’ll find in most every blog feed.



 [1]: http://us3.php.net/manual/en/function.simplexml-load-string.php
 [2]: http://us3.php.net/manual/en/ref.libxml.php#libxml.constants "additional Libxml parameters"