Deru Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

Fixing libxml, php bug and issues with HTML entities by downgrading libxml

Add comment
Views: 787
Votes: 0
Comments: 0
Posted: 13 Aug, 2009
by: Nini E.
Updated: 27 Aug, 2010
by: Joseph S.

When you parse XML with PHP and libxml 2.7.0, all HTML entities gets stripped out. This is a known bug with libxml 2.7.0 and this bug mess up a lot of things.

The solution for this is to downgrade libxml to an older version. The steps are given below:

        1. First you will have to install an older version of libxml, I installed libxml 2.6.30.
                   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


        2. Next step is 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*

        3. Now you will have to let WHM know that we want to compile PHP with this new libxml. We can do it by the following commands:

	cd /var/cpanel/easy/apache/rawopts/

            There will be a file namely "all_php5". If it is there edit it, otherwise create the file. Add the following 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 >> EasyApache (Apache Update)

            or you can do it from backend by the script

	/scripts/easyapache

            You should be all set.  

        4. To check the current version of libxml:

	php -i | grep libxml
Others in this Category
document Running php4 and php5 together in server
document changing php values using .htaccess
document Track the "nobody mail senders" using PHP
document Using Curl to call a URL
document use Curl to POST data to a form.
document How to use curl to get the file contents
document Steps to install FFMPEG as an module in PHP
document Mambo Admin "All contents Item" - join error
document How to install SSH2 for PHP Shell?
document Album access issue in Gallery
document How to install APC (Alternative PHP Cache)
document Upgrade from PHP4 to PHP5: Backward Incompatible Changes
document CAPCHA implementation in the Contact Page submission form



RSS