View Full Version : [solved] PHP error with xsl and libxml 2.7.8
10-10-2011, 12:04 PM
With PHP (5.2.17 and 5.3.8) built for LiteSpeed using libxml 2.7.8 and libxslt 1.2.6, scripts attempting to use the XSL support display a 503 forbidden error page. The following shows up in stderr.log:
2011-10-10 13:41:17.711 [STDERR] lsphp5test:<snip>: symbol lookup error: /opt/xslt/lib/libxslt.so.1: undefined symbol: xmlXPathCompiledEvalToBoolean
The exact same build / versions work just fine with Apache suphp.
Downgrading libxml to 2.7.7 and rebuilding libxslt to use this older version addresses this problem with LiteSpeed.
We need a fix for this with LiteSpeed and libxml 2.7.8. EasyApache uses 2.7.8 in its current builds so this is likely to be a widespread problem for those rebuilding PHP based on libraries built by EasyApache. Please advise.
10-10-2011, 12:55 PM
if you build matching PHP from WHM plugin, lsphp5 will use the same libxml as Apache suphp.
cpanel install libxml in /opt/xml2, you should not try to install another version of libxml2.
Just follow cPanel's PHP configuration.
10-10-2011, 02:29 PM
That's exactly the problem. If you use what cPanel creates, which is now libxml 2.7.8, any script attempting to uses xsl does not work under LiteSpeed as noted. The only work around is to manually build libxml 2.7.7 and rebuild libxslt using this older libxml.
10-10-2011, 03:04 PM
I'm still trying to identify where in the code exactly the PHP scripts are dieing but a simple example that does not work is phpSysInfo using disp=static in the URL (it defaults to disp=dynamic if you have java script enabled).
10-10-2011, 06:25 PM
try "ldd /usr/local/lsws/fcgi-bin/lsphp5"
if it does not link to /opt/xml2/lib/libxml2.so.2, the lsphp binary was not built correctly, you need to upgrade to latest 4.1.5 and "build matching PHP" again.
if the problem persist after upgrading to 4.1.5, please contact bug@litespeed with temp root access in order for us to trouble shot it.
10-10-2011, 09:20 PM
Thanks, that helped me narrow down this issue. The --with-libxml-dir=/opt/xml2 doesn't seem to be working as one might expect. ldd reports /usr/lib64/libxml2.so.2.
Using your build matching PHP from the WHM plugin doesn't have this issue, ldd reports /opt/xml2/lib/libxml2.so. Even a fresh rebuild using the same /home/cpeasyapache/ls.src/php-5.2.17 source and configure results in the same problem.
I stumbled upon this (http://www.litespeedtech.com/support/forum/showthread.php?t=3703) thread which touches on the subject but I'm just curious to know what you guys are using as the work around in your own build script to address this.
10-10-2011, 10:13 PM
If you really have to build it manually, the fix is in
"Build matching PHP" apply similar fix.
10-11-2011, 12:08 AM
Perfect. Works like a charm. Thanks!