2

I wrote a PHP-script to execute another PHP-file in the terminal and got an error. If I run:

$output = shell_exec("/usr/bin/php -v 2>&1");
echo "<PRE>$output</PRE>";

then I get this message:

/usr/bin/php: /opt/lampp/lib/libxml2.so.2:
version `LIBXML2_2.9.0' not found (required by /usr/bin/php)

I tried to goolge it but the answers were too hard to understand for me, I'm quite new to all this.. Could somebody explain the problem or help me fix it? All I can understand is that I obviously got a wrong version of something.

sotirov
  • 4,379

1 Answers1

3

Your library version is too old. You need libxml2 >=2.9.0

For Trusty and newer install the package libxml2

sudo apt-get install libxml2

remove the old library (backup)

mv /opt/lampp/lib/libxml2.so.2 /opt/lampp/lib/libxml2.so.2.bak

and create a symbolic link

ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2 /opt/lampp/lib
A.B.
  • 92,125