You Are Here Home > October 2008

October 2008

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

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
Comments (15)   Filed under: Annoying Stuff,PHP,Server,Web Development   Posted by: Codehead

xml_set_character_data_handler problems with HTML entities like < >

This is a big issue and broke a lot of our websites unfortunately.
The problem is that the cdata_handler will be called when the parser finds tokens like < and passes nothing to your cdata_handler which it’s suppose to pass things like < or >.

The problem is with libxml 2.7.0 and 2.7.1 and 2.7.2 fixes the issue:
http://xmlsoft.org/news.html

They say 2.7.2 fixes it but it doesn’t really, it’s very disappointing.

xml_set_character_data_handler problems with HTML entities like < >
Comments (0)   Filed under: PHP,Web Development   Posted by: Codehead

Cool free programming books you can download

Here is the link:
http://mindview.net/Books/DownloadSites

Use any of the mirror links to download these great books by Bruce Eckel.
I read his thinking in C++ a while ago and it’s really great.

His book on design patterns in Python is the one I’m reading now.

Cool free programming books you can download
Comments (0)   Filed under: General,Programming   Posted by: Codehead

Problems installing ffmpeg: warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID X

Here is how to install ffmpeg:

1 – Create a file named “dag.repo” (no quotes) in “/etc/yum.repos.d”
2 – Copy and paste these lines in it:

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1

You will need a newline at the end of the file.

3 – Then run “yum install ffmpeg ffmpeg-devel” (no quotes)

This should install it with no issues, note that I set gpgcheck=0, if you search for it you will see a lot of people are suggesting: gpgcheck=1 which yields to something like:
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID X

Problems installing ffmpeg: warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID X
Comments (0)   Filed under: General,Server   Posted by: Codehead

Flash CS3 is slow on Windows Vista

Here is how to fix it:
1 – Right click on Flash’s desktop (or whatever) icon and then click “Properties”
2 – Go to compatibility tab
3 – Check the box “Run this program in compatibility mode for:”
4 – From the drop down select “Windows XP (Service Pack 2)”
5 – Open Flash

And that’s it, it will run smoothly, or at least it did for me.

Flash CS3 is slow on Windows Vista
Comments (5)   Filed under: Actionscript,Annoying Stuff,Flash   Posted by: Codehead
« Newer Posts