PDA

View Full Version : how to downgrade libxml2



roly
10-26-2008, 02:18 PM
hi

there is a bug in the 2.7.2 version of libxml2 that i'm using that removes angle brackets from html in uploaded wordpress posts. to get round this i need to downgrade libxml2.

so basically i need to downgrade libxml2 to version 2.6.32 (libxml2-2.6.32) which apparently doesn't have this bug. has anyone got any idea how i can do this without breaking something? i've tried "yum remove libxml2" but there are lots of dependencies including bind. i also see that libxml2 is within custombuild, which is why i'm asking here.

any advice greatly appreciated

thanks in advance

roland

Dravu
10-27-2008, 06:21 AM
I'd probably do the following:

cd /usr/local/directadmin/custombuild/
wget http://xmlsoft.org/sources/libxml2-2.6.32.tar.gz
That will download the version you want. Next, edit the versions.txt file:

nano -w versions.txt
Find the line that says "libxml2:2.7.2:dc43ff7ae6aded45f578c87b7b0c8766" and replace it with:

libxml2:2.6.32:2621d322c16f0257e30f0ff2b13384de
Do Ctrl + X and hit Y to save the file. Next, edit the options.conf file:

nano -w options.conf
Find the line that says "autover=yes" and change it to "autover=no". Save that file and then just do:

./build libxml2 and it'll build the downgraded version. Really wish there was an easier method of doing it, but that's that's the only way I know of right now. Also, unless you go back and change the last part back to "autover=yes", you'll have to do "./build update" to get the updated versions file and see what new versions of software is available.

roly
10-27-2008, 06:45 AM
I'd probably do the following:

That will download the version you want. Next, edit the versions.txt file:

Find the line that says "libxml2:2.7.2:dc43ff7ae6aded45f578c87b7b0c8766" and replace it with:

Do Ctrl + X and hit Y to save the file. Next, edit the options.conf file:

Find the line that says "autover=yes" and change it to "autover=no". Save that file and then just do:
and it'll build the downgraded version. Really wish there was an easier method of doing it, but that's that's the only way I know of right now. Also, unless you go back and change the last part back to "autover=yes", you'll have to do "./build update" to get the updated versions file and see what new versions of software is available.


thanks dravu, you're a star :) that's sorted it out. hopefully they will fix this bug in the next update. thanks again.

roland

roly
10-28-2008, 02:35 AM
i was a bit premature there, it hasn't sorted it out. but i know that the bug in libxml2-2.7.2 is the problem, but downgrading it doesn't seem to have helped. i also tried downgrading the libxml2, libxml2-devel and libxml2-python that yum updates (is this the same libxml2 that custombuild installs) but even that hasn't sorted it out. i even tried a "./build all d" incase php or apache was linked to 2.7.2 version. has anyone else got any suggestions?

Dravu
10-28-2008, 07:07 AM
i was a bit premature there, it hasn't sorted it out. but i know that the bug in libxml2-2.7.2 is the problem, but downgrading it doesn't seem to have helped. i also tried downgrading the libxml2, libxml2-devel and libxml2-python that yum updates (is this the same libxml2 that custombuild installs) but even that hasn't sorted it out. i even tried a "./build all d" incase php or apache was linked to 2.7.2 version. has anyone else got any suggestions?
Well Yum builds from packages, while Custombuild builds from the actual source files. That's why Yum will show different versions than what you have. So are you just still having the same problems that you were with 2.7.2?

roly
10-28-2008, 08:15 AM
Well Yum builds from packages, while Custombuild builds from the actual source files. That's why Yum will show different versions than what you have. So are you just still having the same problems that you were with 2.7.2?

hi, yes i still seem to have the same problem as 2.7.2

floyd
10-29-2008, 06:20 AM
It sounds like you have both installed, one from yum and the other from custombuild.


rpm -q libxml2

If that shows 2.7.2 then you definitely have the 2.7.2 installed via yum or other rpm.

This is what I use when I want to replace a package.

yum install yum-utils #if it is not already installed
yumdownloader yumdownloader libxml2-2.6.26 #or whatever version matches your system
rpm -i --replacefiles --replacepkgs --upgrade libxml2-2.6.26-2.1.2.6.i386.rpm

roly
10-30-2008, 02:08 AM
It sounds like you have both installed, one from yum and the other from custombuild.


rpm -q libxml2

If that shows 2.7.2 then you definitely have the 2.7.2 installed via yum or other rpm.

This is what I use when I want to replace a package.

yum install yum-utils #if it is not already installed
yumdownloader yumdownloader libxml2-2.6.26 #or whatever version matches your system
rpm -i --replacefiles --replacepkgs --upgrade libxml2-2.6.26-2.1.2.6.i386.rpm


thanks floyd, i'll check it out and report back with my results.

nickutis
11-04-2008, 06:09 AM
Roly, have you figured out how to fix this? I'm having the same issue..

roly
11-04-2008, 10:25 AM
Roly, have you figured out how to fix this? I'm having the same issue..

i've not had chance to try what floyd suggested yet but when i do i'll report back with my results.

smtalk
11-04-2008, 12:35 PM
http://bugs.php.net/bug.php?id=45996

roly
11-10-2008, 02:55 PM
i've still not solved this. it still seems to be using the buggy version. this is what i have done so far, can anyone offer a suggestion?

i removed the yum installed libxml2, libxml2-devel etc with "rpm -e --nodeps", i added libxml2* to my exclude list in yum.conf.

i then used dravu's suggestion of downloading an earlier version of libxml2 and changing custombuilds version.txt and rebuilding libxml2 with custombuild, i've also tried a "./build all" with the modified versions.txt, and yet i am still getting the same problem.

has anyone encountered this and managed to solve it? it's driving me nuts.:eek:

or any further suggestions appreciated.

i notice in the link that smtalk has posted, they suggest am alternative work around of building php with "build ext/xml with expat". is this something i can do with custombuild?

smtalk
11-11-2008, 01:37 AM
Yes, you can build PHP with libexpat (add --with-libexpat-dir=/usr (make sure you have expat-devel installed on your system), or just patch PHP to fix the problem: http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch

roly
11-11-2008, 03:46 AM
Yes, you can build PHP with libexpat (add --with-libexpat-dir=/usr (make sure you have expat-devel installed on your system), or just patch PHP to fix the problem: http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch

hi Martynas

thanks for the reply. excuse my ignorance but how to i go about applying that patch you mentioned?

and as far as building php with libexpat, i assume with custombuild i just edit (in my case apache2/php5) the /usr/local/directadmin/custombuild/configure/ap2/configure.php5 file, and then rebuild?

smtalk
11-11-2008, 04:41 AM
cd /usr/local/directadmin/custombuild
./build clean
./build update
tar xzf php-5.2.6.tar.gz
wget http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch
patch -p0 < php-5.2.6-xmlwformed.patch
cd php-5.2.6
../configure/ap2/configure.php5
make
make install


That's it, restart apache now :)

roly
11-11-2008, 05:46 AM
cd /usr/local/directadmin/custombuild
./build clean
./build update
tar xzf php-5.2.6.tar.gz
wget http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch
patch -p0 < php-5.2.6-xmlwformed.patch
cd php-5.2.6
../configure/ap2/configure.php5
make
make install


That's it, restart apache now :)

thanks! i'll give a try and report back :)

roly
11-11-2008, 07:15 AM
cd /usr/local/directadmin/custombuild
./build clean
./build update
tar xzf php-5.2.6.tar.gz
wget http://people.apache.org/~jorton/php-5.2.6-xmlwformed.patch
patch -p0 < php-5.2.6-xmlwformed.patch
cd php-5.2.6
../configure/ap2/configure.php5
make
make install


That's it, restart apache now :)

thank you, works perfectly now :). and thanks to the others who offered some input on this problem, it's appreciated.

Dark
11-19-2008, 12:35 AM
I've got that error:

checking for MySQL UNIX socket location... /tmp/mysql.sock
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
../configure/ap2/configure.php5: --with-mysqli=/usr/local/mysql/bin/mysql_config: not found


or that (if --with-mysqli without path)

configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
--with-mysqli: not found


I tryed --with-mysql=/usr/local/mysql or --with-mysql=/usr/
But nothing. I get the same error.

After installing mysqlclient:



+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+

Thank you for using PHP.

--with-mysqli: not found

Dark
11-19-2008, 04:44 AM
reinstalled php;
Followed this thread http://www.directadmin.com/forum/showthread.php?p=143719 ;
And I still got error:

Warning: DOMDocument::loadXML(): Unsupported encoding windows-1251 in Entity, line: 1 in /root/test.php on line 2


FreeBSD 6.3 installed on my server.
I found in the internet that it ts FreeBSD's bug.

smtalk
11-19-2008, 05:25 AM
http://bugs.php.net/bug.php?id=45241

Dark
11-19-2008, 05:35 AM
I'm glad to say that i found the solution.
The problem was that libxml2 don't see iconv (by default);
I solved this problem by recompiling libxml2 --with-iconv=/usr/local



#cd /usr/local/directadmin/custombuild
#tar -zxvf libxml2-2.6.32.tar.gz
#cd libxml2-2.6.32
#./configure --with-iconv=/usr/local
#make
#make install

smtalk
01-20-2009, 01:12 AM
ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz

It's a fix for http://bugs.php.net/bug.php?id=45996 too (with future PHP releases).

vovaNux
02-07-2009, 12:52 AM
Obviously, the simple upgrade/downgrade of libxml2 doesn't solve the issue.See here for a complete solution: http://www.lampdocs.com/blog/2009/02/07/php-deletes-angle-brackets-while-parsing-html-how-to-solve/