-1

I'm getting an error whenever PHP (5.6) is starting from the command line (and crons) :

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/xsl.so' - libexslt.so.0: cannot open shared object file: No such file or directory in Unknown on line 0

Box is Ubuntu 14.04

Output from php -v

mike@wilma:/etc/php$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/xsl.so' - libexslt.so.0: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.39-1+ubuntu14.04.1+deb.sury.org+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Before I go any futher, YES I have looked on Google, YES I have looked in StackExchange.

The previous output seems to be telling me that the file /usr/lib/php/20131226/xsl.so doesn't exist even though it does :

mike@wilma:/etc/php$ file /usr/lib/php/20131226/xsl.so
/usr/lib/php/20131226/xsl.so: ELF 64-bit LSB  shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=6a6f306c06290733b42ea9290839aefd897d3205, stripped

Having determined that the file exists, permissions should be checked

mike@wilma:/etc/php$ ls -l /usr/lib/php/20131226/xsl.so
-rw-r--r-- 1 root root 39016 Dec 12 19:31 /usr/lib/php/20131226/xsl.so

So now I know that the file exists and is accessible. The next thing to check for is that the file is included in configuration

mike@wilma:/etc/php$ find . -name "*xsl*" -ls
2752689    0 lrwxrwxrwx   1 root     root           35 Dec 19 16:27 ./5.6/apache2/conf.d/20-xsl.ini -> /etc/php/5.6/mods-available/xsl.ini
2752810    4 -rw-r--r--   1 root     root           66 Dec 12 19:30 ./5.6/mods-available/xsl.ini
2752696    0 lrwxrwxrwx   1 root     root           35 Dec 19 16:27 ./5.6/cli/conf.d/20-xsl.ini -> /etc/php/5.6/mods-available/xsl.ini

The references seem to be there. Is there any other configuration directive ?

mike@wilma:/etc/php$ find . -type f -exec grep -H 'xsl' {} \;
./5.6/apache2/php.ini:;extension=php_xsl.dll
./5.6/mods-available/xsl.ini:extension=xsl.so
./5.6/cli/php.ini:;extension=php_xsl.dll
The .dll extensions are rightly commented out, it looks to me like the configuration is spot on. Next thing to do would be to make sure the extension is enabled. To do this, disable then enable the extension
mike@wilma:/etc/php$ sudo phpdismod xsl
mike@wilma:/etc/php$ sudo phpenmod xsl
Absolutely no output from either command, I have to assume they did the right thing.

Other suggestions were to reinstall xsl

mike@wilma:/etc/php$ sudo apt-get install --reinstall php5.6-xsl
Reading package lists... Done
Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 10 not upgraded. Need to get 0 B/261 kB of archives. Preparing to unpack .../php5.6-xsl_5.6.39-1+ubuntu14.04.1+deb.sury.org+1_all.deb ... Unpacking php5.6-xsl (5.6.39-1+ubuntu14.04.1+deb.sury.org+1) over (5.6.39-1+ubuntu14.04.1+deb.sury.org+1) ... Setting up php5.6-xsl (5.6.39-1+ubuntu14.04.1+deb.sury.org+1) ...

Check again ...

mike@wilma:/etc/php$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/xsl.so' - libexslt.so.0: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.39-1+ubuntu14.04.1+deb.sury.org+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

No change ! I'm at a loss. Has anyone got any clues/hints. I'd rather not remove PHP 5.6 and reinstall it.

1

The message you received does not state that /usr/lib/php/20131226/xsl.so is missing, as you seemed to think. It states that the library it is trying to load, libesxlt.so.0, is missing.

In Ubuntu 14.04 this library is located in the package (strangely) named libxslt1.1. Installing this package will allow you to load the PHP extension.

-1

Solved ! The clue was at the PHP site, XSL configuration :

PHP 5 includes the XSL extension by default and can be enabled by adding the argument --with-xsl[=DIR] to your configure line (DIR being the libxslt installation directory).

In the directories /etc/php/5.6/apache2/conf.d and /etc/php/5.6/cli/conf.d I created a directory do-not-run. I moved the files 20-xsl.ini to the relevant do-not-run directory and tried php -v again.

mike@wilma:/etc/php/5.6/apache2/conf.d$ php -v
PHP 5.6.39-1+ubuntu14.04.1+deb.sury.org+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

After reloading the Apache2 server, pages were still being served. I hope this helps someone else and saves them the day or 2 I spent trying to resolve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.