When you parse XML with PHP and libxml 2.7.0, all HTML entities were stripped out and this annoying bug messed up a lot of things and no one seems to care enough to fix this.
This bug is also reported here:
http://bugs.php.net/bug.php?id=45996
http://bugs.typo3.org/view.php?id=9359&nbn=2
From reading these few resources, I knew I had to downgrade to an older version of libxml but since I’m not very good at Linux I had no idea how to.
But I finally figured this out and here is how to do it with WHM/cPanel:
First you will have to install an older version of libxml, I installed libxml 2.6.30.
You will need an SSH client and you will have to login to your server with root, I use Putty:
http://www.chiark.greenend.org.uk/~sgtatham/putty/
Download it, run it, enter the IP address of your server, enter root and enter your password.
Then do:
cd /opt
mkdir libxml
cd libxml
wget http://xmlsoft.org/sources/libxml2-2.6.30.tar.gz
tar xvzf libxml2-2.6.30.tar.gz
cd libxml2-2.6.30
./configure –bindir=/opt/libxml/ –sbindir=/opt/libxml/ –libexecdir=/opt/libxml/ –datadir=/opt/libxml/ –sysconfdir=/opt/libxml/ –sharedstatedir=/opt/libxml/ –libdir=/opt/libxml/ –includedir=/opt/libxml/ –oldincludedir=/opt/libxml/
make && make install
Now you will need to update yum.conf to prevent it from updating libxml back, so edit:
/etc/yum.conf
And find the line that starts with:
exclude=
And add libxml* to the end of it so this line should look something like this:
exclude=apache* bind-chroot courier* dovecot* exim* httpd* mod_ssl* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail* libxml*
Now we will have to let WHM know that we want to compile PHP with this new libxml path so go to:
/var/cpanel/easy/apache/rawopts/
There might be a file there named: “all_php5″ (no quotes) if there is edit it if there is not create it and add these lines to the end of it:
–with-libxml-dir=/opt/libxml
–with-libxml-dir=/opt/libxml/
Now go ahead and build Apache and PHP using:
WHM >> Main >> Software >> Apache Update
You should be all set.
Please note:
1 – Do this on your own risk.
2 – I’m not very good at Linux so please let me know if there is an easier method.
3 – This worked great on my CentOS.
4 – If you have never used WHM’s Apache Update, go ahead and read about it first.
Fixing libxml, php bug and issues with HTML entities; downgrading libxml