libxml Upgrade

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
CylonCenturion

Re: libxml Upgrade

Post by CylonCenturion » Tue May 03, 2016 6:46 pm

hanswurstgesicht wrote:It took some time, till I figured out, that my Owncloud installation needs a newer libxml version since version 9. Any news on that?

Thanks!

No :S

johnripper
Experience counts
Posts: 1345
Joined: Sun Aug 14, 2011 5:13 am

Re: libxml Upgrade

Post by johnripper » Fri May 20, 2016 3:19 pm

All participants on this thread are advised to contact QNAP helpdesk with a feature request on that: https://helpdesk.qnap.com

johnripper
Experience counts
Posts: 1345
Joined: Sun Aug 14, 2011 5:13 am

Re: libxml Upgrade

Post by johnripper » Tue Jun 07, 2016 5:07 pm

-->
johnripper wrote:All participants on this thread are advised to contact QNAP helpdesk with a feature request on that: https://helpdesk.qnap.com

AcidBurns87
New here
Posts: 4
Joined: Wed Dec 19, 2012 7:15 am

Re: libxml Upgrade

Post by AcidBurns87 » Sun Jun 19, 2016 5:03 am

Ok, so since the libxml2.2.6.30 is from 2008 and qnap is not willing to provide any upgrade for it, here is the quick and dirty solution.

My Qnap 569L is running fine with this fix on QTS4.2.1 build 20160601, however I urge you to:
1. have a backup in case everything fails,
2. have someone who can boot the nas with a different operatingsystem to fix if something fails completely,
3. have some BASIC knowledge in linux shells so that you can debug on your own.

What we are going to do:
1. simply replace the libxml2.so.2.6.30 with the one from the medialibrary (version 2.9.2 at the moment)
2. fix owncloud 9.0.2 to look for the actual loaded libxml, not the one apache was compiled against.
3. fix some warning that tells us we fiddled with the owncloud core.

IMPORTANT:
THIS WON'T SURVIVE A FIRMWARE UPDATE. So you HAVE to do it again EVERYTIME you update. No guarantee that this will work with any future qnap updateS!
THIS WON'T SURVIVE A OWNCLOUD UPDATE. So you HAVE to do it again EVERYTIME you update owncloud. No guarantee that this will work with any future owncloud updates!

(But the bug is already reportet and they probably will fix it in the next update so that you don't have to fiddle with the owncloud core anyways).

Step 1:
Replace libxml2:
log in to your nas via ssh, issue the following codes after another:

Code: Select all

cd /usr/lib
mv libxml2.so.2.6.30 /share/CACHEDEV1_DATA/.qpkg/
cp /usr/local/medialibrary/lib/libxml2.so.2.9.2 .
ln -sf libxml2.so.2.9.2 libxml2.so
ln -sf libxml2.so.2.9.2. libxml2.so.2
/etc/init.d/Qthttpd.sh restart


Check if the libxml2 is correctly loaded by issuing the following command:

Code: Select all

/usr/local/apache/bin/php -i | grep libXML

If everything is ok, it should look like this:
libXML support => active
libXML Compiled Version => 2.6.30
libXML Loaded Version => 20902
libXML streams => enabled


Step 2:
Patch the util.php from owncloud:
You should already have downloaded and extracted owncloud 9.0.2 somewhere on your nas. You should also know the path to that.

Code: Select all

chmod -R httpdusr:administrators /share/Web/owncloud
is perhaps also necessary.

There is a bug in the current owncloud (9.0.2) which does only check the libxml2 version used to compile the apache, not which version is loaded.

Code: Select all

sed -i 's/LIBXML_DOTTED_VERSION/LIBXML_LOADED_VERSION/g' /share/Web/owncloud/lib/private/util.php

Replace the "..." with the actual path to your ownloud. If you used the standard installation, this path SHOULD work.

Now open the owncloud website and do the upgrade/install (or put some values in the config.php or whatever it needs to get owncloud running)

Step 3:
Patch the checksum warnings:
This is not necessary, but it's just annoying when logging in as admin and owncloud complains about the wrong checksum on the util.php.
Since owncloud is using code signing to prevent malicious software to modify the core libraries, it's perfectly legit for the warning to appear.
Altering the signature file will also not help, since this file is also checksumed.
So the only way to get rid of the warning is to set the branch of owncloud to something other than stable. We will set it to "custom":
sed -i 's/stable/custom/g' /share/Web/owncloud/version.php

Replace the path to owncloud with your actual path as above.

This should be it. Owncloud 9.0.2 on QTS 4.2.1 20160601 should be ready to rumble.

-Acid

stonerocker
New here
Posts: 2
Joined: Wed Jul 06, 2016 9:21 am

Re: libxml Upgrade

Post by stonerocker » Thu Jul 07, 2016 10:12 pm

I was submitting a ticket. QNAP Support told me they want to investigate the problem and eventually consider it in a coming software release...

goodelyfe
Know my way around
Posts: 118
Joined: Tue Jul 01, 2014 5:50 pm

Re: libxml Upgrade

Post by goodelyfe » Thu Jul 07, 2016 11:12 pm

Lip service

Strandlaeufer
First post
Posts: 1
Joined: Sun Jun 21, 2015 4:47 am

Re: libxml Upgrade

Post by Strandlaeufer » Fri Jul 22, 2016 1:45 am

Thank you!
Worked fine for Owncloud 9.0.2 on my TVS-671

Code: Select all

There is a bug in the current owncloud (9.0.2) which does only check the libxml2 version used to compile the apache, not which version is loaded.

Code: Select all
sed -i 's/LIBXML_DOTTED_VERSION/LIBXML_LOADED_VERSION/g' /share/Web/owncloud/lib/private/util.php


After Upgrade to Owncloud 9.1.0 the util.php is at another place. Now the file is placed at owncloud/lib/private/legacy/util.php

So you have to write a line like this:

Code: Select all

 sed -i 's/LIBXML_DOTTED_VERSION/LIBXML_LOADED_VERSION/g' /share/Web/owncloud/lib/private/legacy/util.php

QPeterQ
New here
Posts: 5
Joined: Tue Feb 05, 2013 3:19 pm

Re: libxml Upgrade

Post by QPeterQ » Wed Aug 31, 2016 5:49 am

CAUTION: Before applying the workaround described here read the whole post!

The old libxml2 can be found in /usr/lib. The relevant directory entries are as follows:

libxml2.so -> libxml2.so.2
libxml2.so.2 -> libxml2.so.2.6.30
libxml2.so.2.6.30

My workaround (execute commands in SSH shell):

(1) Find a more recent version of the libxml2 library on your system

Code: Select all

find / -name libxml*


(2) Copy the more recent version into /usr/lib (in my case the path was /mnt/ext/opt/medialibrary/lib/libxml2.so.2.9.2)

Code: Select all

cp /mnt/ext/opt/medialibrary/lib/libxml2.so.2.9.2 /usr/lib


(3) Change the symlink pointing to the old library to have it point to the newer version

Code: Select all

rm libxml2.so.2
ln -s libxml2.so.2.9.2 libxml2.so.2


After that, I was able to install Nextcloud 10.
I also haven't noticed anything else in the system broken after the modification.

However: I'm not sure about the implications this might have on the overall system – probably some software running on the NAS depends on the older libxml2 library?

In case you encounter problems after applying this workaround, just set the symlink from step (3) to the original state again:

Code: Select all

ln -s libxml2.so.2.6.30 libxml2.so.2


Thanks for sharing your experience here and for comments/improvements!

CylonCenturion

Re: libxml Upgrade

Post by CylonCenturion » Wed Aug 31, 2016 11:11 am

QPeterQ wrote:CAUTION: Before applying the workaround described here read the whole post!

The old libxml2 can be found in /usr/lib. The relevant directory entries are as follows:

libxml2.so -> libxml2.so.2
libxml2.so.2 -> libxml2.so.2.6.30
libxml2.so.2.6.30

My workaround (execute commands in SSH shell):

(1) Find a more recent version of the libxml2 library on your system

Code: Select all

find / -name libxml*


(2) Copy the more recent version into /usr/lib (in my case the path was /mnt/ext/opt/medialibrary/lib/libxml2.so.2.9.2)

Code: Select all

cp /mnt/ext/opt/medialibrary/lib/libxml2.so.2.9.2 /usr/lib


(3) Change the symlink pointing to the old library to have it point to the newer version

Code: Select all

rm libxml2.so.2
ln -s libxml2.so.2.9.2 libxml2.so.2


After that, I was able to install Nextcloud 10.
I also haven't noticed anything else in the system broken after the modification.

However: I'm not sure about the implications this might have on the overall system – probably some software running on the NAS depends on the older libxml2 library?

In case you encounter problems after applying this workaround, just set the symlink from step (3) to the original state again:

Code: Select all

ln -s libxml2.so.2.6.30 libxml2.so.2


Thanks for sharing your experience here and for comments/improvements!


thanks, but qnap has been migrated to nextcloud, so a libxml2 is no longer required.

chrisfetz
New here
Posts: 4
Joined: Wed Jul 27, 2016 8:58 pm

Re: libxml Upgrade

Post by chrisfetz » Mon Sep 12, 2016 7:06 pm

Hi,

sorry, the prosed workaround did not work for me (TS412). After exchanging the libxml the complete webserver did not work properly (even the administration website).
What was meant by
thanks, but qnap has been migrated to nextcloud, so a libxml2 is no longer required.


as far as I found out, there was only a bugfix in nextcloud to correctly compare against the loaded lib, not only the compiled....

Regards,
Christoph

Mikiya
Getting the hang of things
Posts: 85
Joined: Tue Feb 09, 2016 4:07 pm

Re: libxml Upgrade

Post by Mikiya » Fri Sep 23, 2016 4:43 pm

Do you have any news about this upgrade ? Still on 8.2.X branch because of this old lib :(
TS-251+ 4Go - RAID 1 Seagate 3To - Eaton 3S 550

afyonluoglu
First post
Posts: 1
Joined: Sun Jan 10, 2016 7:01 am

Re: libxml Upgrade

Post by afyonluoglu » Wed Nov 09, 2016 4:06 am

Is there any news since i have same problem because of old version of libxml !!!
Still waiting for QNAP-Team response ....

Mikiya
Getting the hang of things
Posts: 85
Joined: Tue Feb 09, 2016 4:07 pm

Re: libxml Upgrade

Post by Mikiya » Wed Nov 09, 2016 4:15 am

I don't think there is any news :/
But a small script with Step 1 of the solution of AcidBurns87, execute it after any QTS update and you are fine, you can use the last version of NextCloud. It's the best option to deal with until QNAP change the default lib.
TS-251+ 4Go - RAID 1 Seagate 3To - Eaton 3S 550

CylonCenturion

Re: libxml Upgrade

Post by CylonCenturion » Wed Nov 09, 2016 6:51 am

Mikiya wrote:I don't think there is any news :/
But a small script with Step 1 of the solution of AcidBurns87, execute it after any QTS update and you are fine, you can use the last version of NextCloud. It's the best option to deal with until QNAP change the default lib.


qnap will, from my point of view, never upgrade libxml2, but only discontinue owncloud.

lagoon
First post
Posts: 1
Joined: Sun Nov 02, 2014 2:01 am

Re: libxml Upgrade

Post by lagoon » Sun Nov 13, 2016 7:29 pm

I have the same problem running baikal (caldav / carddav server). It needs a newer libxml than the 2.6.30 that is used by php on QNAP. I'd really appreciate a FW-Upgrade with a recent libxml2.

Update:

Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”