You are not logged in.

#1 2018-01-01 11:47:10

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

PHP Startup: Unable to load dynamic library

I have two hosts with identical PHP 7.2.0-2 environments that serve a flat-file CMS. I first noticed this problem when httpd on host 1 would failover to host 2 and the CMS on host 2 complaining about not having gd, curl and zip modules loaded or installed. They have been. When I looked closer at host 2 I stumbled upon this.

Failed loading /usr/lib/php/modules/opcache.so:  /usr/lib/php/modules/opcache.so: undefined symbol: zend_known_strings
PHP Warning:  PHP Startup: bz2: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.so: undefined symbol: zend_empty_string in Unknown on line 0
PHP Warning:  PHP Startup: gd: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: gettext: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/iconv.so' - /usr/lib/php/modules/iconv.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imap.so' - /usr/lib/php/modules/imap.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/intl.so' - /usr/lib/php/modules/intl.so: undefined symbol: zend_strpprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ldap.so' - /usr/lib/php/modules/ldap.so: undefined symbol: zend_get_callable_name in Unknown on line 0
PHP Warning:  PHP Startup: sodium: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.so: undefined symbol: zend_vspprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: zend_strpprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_pgsql.so' - /usr/lib/php/modules/pdo_pgsql.so: undefined symbol: zend_strpprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pgsql.so' - /usr/lib/php/modules/pgsql.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/sqlite3.so' - /usr/lib/php/modules/sqlite3.so: undefined symbol: zend_vspprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xmlrpc.so' - /usr/lib/php/modules/xmlrpc.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/zip.so' - /usr/lib/php/modules/zip.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: apcu: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: apc_iterator_obj_init in Unknown on line 0
PHP Warning:  PHP Startup: geoip: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/imagick.so' - /usr/lib/php/modules/imagick.so: undefined symbol: zend_spprintf in Unknown on line 0
PHP Warning:  PHP Startup: rrd: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0

So I checked and found the packages are built for PHP Api Version 20170718.

phpize -v
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718

The really strange thing is host 1 and 2 have the exact same PHP package versions installed.

php 7.2.0-2
php-apache 7.2.0-2
php-apcu 5.1.8-2
php-apcu-bc 1.0.3-3
php-gd 7.2.0-2
php-geoip 1.1.1-3
php-imagick 3.4.3-3
php-imap 7.2.0-2
php-intl 7.2.0-2
php-pear 1:1.10.5-1
php-pgsql 7.2.0-2
php-phpdbg 7.2.0-2
php-rrd 2.0.1-1
php-sodium 7.2.0-2
php-sqlite 7.2.0-2
php-tidy 7.2.0-2
php-xsl 7.2.0-2

The wrongfully claimed missing modules and modules hitting the dynamic library problem are of course loaded in php.ini and other respective conf.d files. I have gone as far as looking at the PKGBUILD for PHP 7.2.0-2 and other PHP related packages, but nothing stood out to me that should be causing this. I've blown away PHP and started fresh to no avail. Host 1 is fine, but not host 2 using the same exact package versions. Both hosts are using reflector to update the mirrors list daily.

I can't wrap my head around this one.

Last edited by cirkit (2018-01-01 11:48:20)

Offline

#2 2018-01-02 20:15:18

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: PHP Startup: Unable to load dynamic library

Are you sure they are using the PHP version you think the problem server is using? Maybe uninstall PHP on the problem server and see if it still runs PHP (thus using some "other" PHP version). Maybe "which php" would work?

That's grasping at straws, of course.


Matt

"It is very difficult to educate the educated."

Offline

#3 2018-01-03 02:15:10

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

Re: PHP Startup: Unable to load dynamic library

Thanks for the response and suggestions.

I've verified PHP 7.2.0 is on both hosts. While on 7.2.0 on host 2 - if I attempt to access a PHP application like Roundcubemail, it spits out a ton of PHP related errors which ultimately causes an HTTP 500 internal error. If I downgrade back to PHP 7.1.10 along with other PHP packages to 7.1.10, PHP is happy again. It doesn't make much sense to me.

I have removed PHP entirely and reinstalled PHP 7.2.0 with only curl.so and zip.so loaded in php.ini. If I restart httpd I see:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.so: undefined symbol: zend_empty_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/zip.so' - /usr/lib/php/modules/zip.so: undefined symbol: zend_spprintf in Unknown on line 0

It almost seems like there is something wrong with the recent PHP packages.

Last edited by cirkit (2018-01-14 21:59:11)

Offline

#4 2018-01-12 07:55:10

Schrottfresse
Member
Registered: 2012-04-04
Posts: 14

Re: PHP Startup: Unable to load dynamic library

Maybe related:

Nextcloud 12  needs php 7.1 as dependency, so a new package php71 was introduced. After installing it I get the following errors in php-fpm:

PHP Warning:  PHP Startup: apcu: Unable to initialize module
Module compiled with module API=20170718
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/memcached.so' - /usr/lib/php/modules/memcached.so: undefined symbol: zend_strpprintf in Unknown on line 0

So it seems that:
- while building php and php71 it was build with the wrong module API.
- there was missing an import (zend_strpprintf)

Offline

#5 2018-01-14 05:52:52

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: PHP Startup: Unable to load dynamic library

Very much unrelated, php71 was only introduced 8 days after this thread was started.

Also see https://bugs.archlinux.org/task/57068


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2018-01-17 21:58:50

partizann
Member
Registered: 2007-07-28
Posts: 9

Re: PHP Startup: Unable to load dynamic library

Had to downgrade to these versions, for nextcloud to work:
memcached 1.5.3-1
php-memcache 3.0.8-5
php-memcached 3.0.3-1

The rest is php71-*

Offline

#7 2018-02-16 13:02:53

carlitoco
Member
From: Berlin
Registered: 2017-02-23
Posts: 12
Website

Re: PHP Startup: Unable to load dynamic library

Still have this problem on Nextcloud 13

PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303

currently installed
memcached 1.5.4-1 [Installiert: 1.5.3-1]
php-memcached 3.0.4-2 [Installiert: 3.0.3-1]
php-redis 3.1.6-1 [Installiert: 3.1.4-1]
php-memcache 3.0.8-6 [Installiert: 3.0.8-5]
php71-apcu 5.1.9-1 instead of php-apcu

if I do an update pacman -Suy

I get these PHP errors and Nextcloud 13 shows me an internal server error page

PHP Warning:  PHP Startup: apcu: Unable to initialize module\nModule compiled with module API=20170718\nPHP    compiled with module API=20160303\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: apc_iterator_obj_init in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/memcache.so' - /usr/lib/php/modules/memcache.so: undefined symbol: zend_strpprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/memcached.so' - /usr/lib/php/modules/memcached.so: undefined symbol: zend_strpprintf in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/redis.so' - /usr/lib/php/modules/redis.so: undefined symbol: zend_spprintf in Unknown on line 0

if I downgrade  everything works fine...
exept of few things like ...

PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: apc_iterator_obj_init at Unknown#0

pacman -U --force /var/cache/pacman/pkg/memcached-1.5.3-1-x86_64.pkg.tar.xz /var/cache/pacman/pkg/php-memcache-3.0.8-5-x86_64.pkg.tar.xz /var/cache/pacman/pkg/php-memcached-3.0.3-1-x86_64.pkg.tar.xz /var/cache/pacman/pkg/php-redis-3.1.4-1-x86_64.pkg.tar.xz

Last edited by carlitoco (2018-02-17 09:37:18)

Offline

#8 2018-02-16 22:38:04

cirkit
Member
From: San Francisco
Registered: 2008-01-29
Posts: 80
Website

Re: PHP Startup: Unable to load dynamic library

Unfortunately despite the recent updates to the different php 7.2 packages, the same errors continue to persist. In my case, this continues to occur when restarting httpd. What did work was replacing the php 7.2 packages from [extra] to the php 7.1 packages from [community] -- notably:

php71 7.1.14-1
php71-apache 7.1.14-1
php71-apcu 5.1.8-2
php71-gd 7.1.14-1
php71-imap 7.1.14-1
php71-intl 7.1.14-1
php71-mcrypt 7.1.14-1
php71-odbc 7.1.14-1
php71-pgsql 7.1.14-1
php71-sqlite 7.1.14-1
php71-tidy 7.1.14-1

I don't use Nextcloud so I cannot comment on its behalf.

Offline

#9 2018-02-17 09:54:24

carlitoco
Member
From: Berlin
Registered: 2017-02-23
Posts: 12
Website

Re: PHP Startup: Unable to load dynamic library

Okay I will try out...

actually it looks like this...
a bit chaotic to me...

[root@wolke64 ~]# pacman -Ss php |grep installed
extra/php-apcu 5.1.9-1  
extra/php-apcu-bc 1.0.3-3  
extra/php-cgi 7.2.2-1  
extra/php-fpm 7.2.2-1  
extra/php-imap 7.2.2-1  
extra/php-odbc 7.2.2-1  
extra/php-pgsql 7.2.2-1  
extra/php-phpdbg 7.2.2-1  
community/php-memcache 3.0.8-6 [ ed: 3.0.8-5]
community/php-memcached 3.0.4-2 [ ed: 3.0.3-1]
community/php71 7.1.14-1  
community/php71-apache 7.1.14-1  
community/php71-gd 7.1.14-1  
community/php71-intl 7.1.14-1  
community/php71-mcrypt 7.1.14-1  
archlinuxfr/php-redis 3.1.6-1 [ ed: 3.1.4-1]

Last edited by carlitoco (2018-02-17 09:57:27)

Offline

Board footer

Powered by FluxBB