Yes. Makes sense. BTW, I did another test and loaded the file directly from /usr/local/lib/libxml2.so.2.9.8 and it is working fine. Thanks.
Thanks & regards, Sujaikumar On Tuesday, April 10, 2018 at 3:09:02 PM UTC+5:30, Graham Dumpleton wrote: > > I still wouldn't have mucked around in /usr/lib64. If installing from > source code, install under /usr/local instead. If you can't rebuild Python > lxml package and define LD_RUN_PATH environment when doing the build, for > where library directory is so automatically found, then force pre-load it > in Apache configuration using: > > LoadFile /usr/local/lib/libxml2.so.2.9.8 > > before loading mod_wsgi module. That way it only applies to Apache. > > On 10 Apr 2018, at 6:46 pm, Sujai Kumar <[email protected] <javascript:>> > wrote: > > Thanks very much sir for your help. > > The following solved the issue. > > I have downloaded the source for libxml and built the libxml2.so.2.9.8 and > made appropriate changes to /usr/lib64 > > sfmgr@lelnxweb5014:/home/a0131597> ls -alrt /usr/lib64/libxml2* > > -rwxr-xr-x 1 root root 1509408 Jun 6 2016 /usr/lib64/libxml2.so.2.9.1 > > -rwxr-xr-x 1 root root 5362880 Apr 9 06:54 /usr/lib64/libxml2.so.2.9.8 > lrwxrwxrwx 1 root root 16 Apr 9 06:54 /usr/lib64/libxml2.so.2 -> > libxml2.so.2.9.8 > > Thanks & regards, > Sujaikumar > > On Monday, April 9, 2018 at 9:28:22 AM UTC+5:30, Graham Dumpleton wrote: >> >> What doesn't make sense if you are running this on the same system is >> that you get: >> >> Running standalone Django server (Works Fine) >> {"LXML_VERSION": [4, 2, 1, 0], "LIBXML_VERSION": [2, 9, 8], >> "LIBXML_COMPILED_VERSION": [2, 9, 8], "LIBXSLT_VERSION": [1, 1, 32], >> "LIBXSLT_COMPILED_VERSION": [1, 1, 32]} >> >> This says that it is finding 2.9.8 for LIBXML_VERSION. >> >> Was this really run on the same server? >> >> All I can guess at the moment is that you are building binary Python >> wheel packages on one system and installing them on another, or simply >> copying across the Python virtual environment to another system, and then >> running mod_wsgi on that system, different to where you are running >> standalone Django server. >> >> In this case, if the build system, and where you are running standalone >> Django server has newer libxml2 package, your binary is going to be built >> for that, so when trying to run it on target system where is older version >> of package, things will fail. >> >> Another issues is why there appears to be no: >> >> libxml2mod.so >> >> under your Python virtual environment. That path is system Python 2.7 >> version of package. There must be an equivalent .so file somewhere. >> >> If you do have two systems, you need to ensure both have same >> libxml2/libxml2-devel packages, if you are copying build artefacts from one >> to the other. >> >> Graham >> >> On 9 Apr 2018, at 1:48 pm, Sujai Kumar <[email protected]> wrote: >> >> >> Here is the output. >> Note: I have removed the 'Permission denied' lines >> >> /usr/lib64/python2.7/site-packages/libxml2mod.so >> /usr/lib64/libxml2.so.2 >> /usr/lib64/libxml2.so.2.9.1 >> >> Thanks & regards, >> Sujaikumar >> >> On Monday, April 9, 2018 at 8:56:58 AM UTC+5:30, Graham Dumpleton wrote: >>> >>> Sorry, one more thing. >>> >>> Can you run: >>> >>> find / -name 'libxml2*so*' >>> >>> Graham >>> >>> On 9 Apr 2018, at 1:21 pm, Graham Dumpleton <[email protected]> >>> wrote: >>> >>> And on CentOS the package is likely called libxml2-devel. >>> >>> Graham >>> >>> On 9 Apr 2018, at 1:19 pm, Graham Dumpleton <[email protected]> >>> wrote: >>> >>> >>> Today, I'm planning to get libxml2.so.2.9.8 into /usr/lib64 location >>> (after removing existing libxml2.so.2.9.1). >>> >>> I'm still wondering how the standalone django server picks 2.9.8 version >>> whereas the apache/mod_wsgi picks 2.9.1. >>> >>> >>> I would strongly recommend against fiddling around with shared libraries >>> in /usr/lib64. You could break a lot more than just this. >>> >>> Where are you intending to get libxml2.so.2.9.8 from? >>> >>> Graham >>> >>> Thanks & regards, >>> Sujaikumar >>> >>> >>> On Monday, April 9, 2018 at 8:06:57 AM UTC+5:30, Graham Dumpleton wrote: >>>> >>>> Are you sure the libxm2-dev package on your system is up to date? >>>> >>>> Can you find the lxml .so file in the Python installation/virtual >>>> environment and run 'ldd' on it to see where it is finding the XML shared >>>> library? >>>> >>>> Graham >>>> >>>> On 9 Apr 2018, at 12:23 pm, Sujai Kumar <[email protected]> wrote: >>>> >>>> I have compiled Python 3.6.3 from sources. >>>> >>>> Thanks & regards, >>>> Sujaikumar >>>> >>>> On Mon 9 Apr, 2018, 5:44 AM Graham Dumpleton, <[email protected]> >>>> wrote: >>>> >>>>> Are you using system Python package, or have you installed a separate >>>>> Python package, eg., Anaconda Python, or self compiled from source code? >>>>> >>>>> Graham >>>>> >>>>> On 8 Apr 2018, at 10:14 pm, Sujai Kumar <[email protected]> wrote: >>>>> >>>>> Hello Sir, >>>>> >>>>> I'm facing a problem with mod_wsgi/lxml configuration. I looked up >>>>> into some of the stackoverflow posts and understood that the issue could >>>>> be >>>>> with Library versions. >>>>> >>>>> etree.tostring() removes characters between '<' and '>' on >>>>> Apache/mod_wsgi where as the plain Django server works just fine. >>>>> >>>>> *Running standalone Django server (Works Fine)* >>>>> {"LXML_VERSION": [4, 2, 1, 0], "*LIBXML_VERSION": [2, 9, 8]*, >>>>> "LIBXML_COMPILED_VERSION": [2, 9, 8], "LIBXSLT_VERSION": [1, 1, 32], >>>>> "LIBXSLT_COMPILED_VERSION": [1, 1, 32]} >>>>> >>>>> *Running Django over mod_wsgi on Apache* >>>>> {"LXML_VERSION": [4, 2, 1, 0], "*LIBXML_VERSION": [2, 9, 1]*, >>>>> "LIBXML_COMPILED_VERSION": [2, 9, 8], "LIBXSLT_VERSION": [1, 1, 32], >>>>> "LIBXSLT_COMPILED_VERSION": [1, 1, 32]} >>>>> >>>>> I confirmed that the version of LIBXML_VERSION are different between >>>>> standalone and mod_wsgi django server. >>>>> >>>>> sfmgr@lelnxweb5014:/data/sfdev/mod_wsgi-4.6.4> ls -lart >>>>> /usr/lib64/libxml2.so.2* >>>>> -rwxr-xr-x 1 root root 1509408 Jun 6 2016 >>>>> */usr/lib64/libxml2.so.2.9.1* >>>>> lrwxrwxrwx 1 root root 16 Aug 15 2016 /usr/lib64/libxml2.so.2 -> >>>>> libxml2.so.2.9.1 >>>>> >>>>> >>>>> *Question?* >>>>> How do I get the LIBXML_VERSION updated to 2.9.8? Are you saying that >>>>> the system package should be updated? I'm wondering how the LXML_VERSION >>>>> for standalone server is picking up 2.9.8 even though the system only >>>>> contains 2.9.1 version. >>>>> >>>>> Kindly help in this regard. Thanks for your help in advance. >>>>> >>>>> Thanks & regards, >>>>> Sujaikumar >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "modwsgi" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at https://groups.google.com/group/modwsgi. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "modwsgi" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at https://groups.google.com/group/modwsgi. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "modwsgi" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/modwsgi. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "modwsgi" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/modwsgi. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/modwsgi. >> For more options, visit https://groups.google.com/d/optout. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
