1 (edited by ggraziella 2020-04-30 14:05:17)

Topic: Many PHP 7.4.5 Unable to load dynamic library after installation

Hello,

I just updated the php version on my centos7 machine with:
wget "--progress=bar:force" //dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm (I actually changed this for my message to be posted because the limit is to one url)
wget "--progress=bar:force" http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
sudo yum -y install --enablerepo=remi-php74 php php-cli php php-opcache php-gd php-curl php-mysqlnd php-common php-fpm php-mysql php-mbstring php-mcrypt php-xml php-pecl-apc php-pear php-pdo
sudo yum -y install php74-php-bcmath.x86_64 php74-php-pecl-zip
sudo yum update -y

But I get these warnings everytime php -v is runned:

[root@centos-7-x64-virtualbox ~]$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'bcmath.so' (tried: /usr/lib64/php/modules/bcmath.so (/usr/lib64/php/modules/bcmath.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/bcmath.so.so (/usr/lib64/php/modules/bcmath.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'imap.so' (tried: /usr/lib64/php/modules/imap.so (/usr/lib64/php/modules/imap.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imap.so.so (/usr/lib64/php/modules/imap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl.so' (tried: /usr/lib64/php/modules/intl.so (/usr/lib64/php/modules/intl.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/intl.so.so (/usr/lib64/php/modules/intl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_global_stats), /usr/lib64/php/modules/mysqli.so.so (/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib64/php/modules/mysql.so (/usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_get_client_info), /usr/lib64/php/modules/mysql.so.so (/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib64/php/modules/pdo_mysql.so (/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib64/php/modules/pdo_mysql.so.so (/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'soap.so' (tried: /usr/lib64/php/modules/soap.so (/usr/lib64/php/modules/soap.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/soap.so.so (/usr/lib64/php/modules/soap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'wddx.so' (tried: /usr/lib64/php/modules/wddx.so (/usr/lib64/php/modules/wddx.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/wddx.so.so (/usr/lib64/php/modules/wddx.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'apc.so' (tried: /usr/lib64/php/modules/apc.so (/usr/lib64/php/modules/apc.so: undefined symbol: zif_apcu_store), /usr/lib64/php/modules/apc.so.so (/usr/lib64/php/modules/apc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mongo.so' (tried: /usr/lib64/php/modules/mongo.so (/usr/lib64/php/modules/mongo.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mongo.so.so (/usr/lib64/php/modules/mongo.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'runkit.so' (tried: /usr/lib64/php/modules/runkit.so (/usr/lib64/php/modules/runkit.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/runkit.so.so (/usr/lib64/php/modules/runkit.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'bcmath.so' (tried: /usr/lib64/php/modules/bcmath.so (/usr/lib64/php/modules/bcmath.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/bcmath.so.so (/usr/lib64/php/modules/bcmath.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'dom' already loaded in Unknown on line 0
PHP Warning:  Module 'fileinfo' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'imap.so' (tried: /usr/lib64/php/modules/imap.so (/usr/lib64/php/modules/imap.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imap.so.so (/usr/lib64/php/modules/imap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl.so' (tried: /usr/lib64/php/modules/intl.so (/usr/lib64/php/modules/intl.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/intl.so.so (/usr/lib64/php/modules/intl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_global_stats), /usr/lib64/php/modules/mysqli.so.so (/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib64/php/modules/mysql.so (/usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_get_client_info), /usr/lib64/php/modules/mysql.so.so (/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib64/php/modules/pdo_mysql.so (/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib64/php/modules/pdo_mysql.so.so (/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0
PHP Warning:  Module 'Phar' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'soap.so' (tried: /usr/lib64/php/modules/soap.so (/usr/lib64/php/modules/soap.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/soap.so.so (/usr/lib64/php/modules/soap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'sqlite3' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'wddx.so' (tried: /usr/lib64/php/modules/wddx.so (/usr/lib64/php/modules/wddx.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/wddx.so.so (/usr/lib64/php/modules/wddx.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'xmlreader' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlwriter' already loaded in Unknown on line 0
PHP Warning:  Module 'xsl' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'apc.so' (tried: /usr/lib64/php/modules/apc.so (/usr/lib64/php/modules/apc.so: undefined symbol: zif_apcu_store), /usr/lib64/php/modules/apc.so.so (/usr/lib64/php/modules/apc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mongo.so' (tried: /usr/lib64/php/modules/mongo.so (/usr/lib64/php/modules/mongo.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mongo.so.so (/usr/lib64/php/modules/mongo.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'runkit.so' (tried: /usr/lib64/php/modules/runkit.so (/usr/lib64/php/modules/runkit.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/runkit.so.so (/usr/lib64/php/modules/runkit.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module 'posix' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvmsg' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvsem' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvshm' already loaded in Unknown on line 0
PHP Warning:  Module 'curl' already loaded in Unknown on line 0
PHP Warning:  Module 'dom' already loaded in Unknown on line 0
PHP Warning:  Module 'fileinfo' already loaded in Unknown on line 0
PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  Module 'Phar' already loaded in Unknown on line 0
PHP Warning:  Module 'posix' already loaded in Unknown on line 0
PHP Warning:  Module 'sqlite3' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvmsg' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvsem' already loaded in Unknown on line 0
PHP Warning:  Module 'sysvshm' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlwriter' already loaded in Unknown on line 0
PHP Warning:  Module 'xsl' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_sqlite' already loaded in Unknown on line 0
PHP Warning:  Module 'xmlreader' already loaded in Unknown on line 0
PHP 7.4.5 (cli) (built: Apr 14 2020 12:54:33) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies

After trying changing the php.ini extensions because of the ".so.so" mentions, those warnings remain. I even tryed to install some of the libraries manually but get:
[root@centos-7-x64-virtualbox ~]# sudo yum install bcmath
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: epel.mirror.far.fi
* remi-safe: fr2.rpmfind.net
No package bcmath available.
Error: Nothing to do 

Could you help me please?
Regards

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

> sudo yum -y install --enablerepo=remi-php74 php php-cli php php-opcache php-gd php-curl php-mysqlnd php-common php-fpm php-mysql php-mbstring php-mcrypt php-xml php-pecl-apc php-pear php-pdo
> sudo yum -y install php74-php-bcmath.x86_64 php74-php-pecl-zip

Why are you mixing php-* and php74-php-* packages ?

Read the FAQ: https://blog.remirepo.net/pages/English-FAQ#scl

For a proper installation, I also recommend you follow carefully the wizard instructions.

https://rpms.remirepo.net/wizard/

> PHP Warning:  PHP Startup: Unable to load dynamic library 'bcmath.so' (tried: /usr/lib64/php/modules/bcmath.so (/usr/lib64/php/modules/bcmath.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/bcmath.so.so (/usr/lib64/php/modules/bcmath.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Looks like you have some extension=bcmath in your php.ini while the extension (php-bcmath) is not installed.

> PHP Warning:  Module 'sysvmsg' already loaded in Unknown on line 0

And looks like you have tons of unneeded "extension" directives in your php.ini

Each package provides a configuration file for its extension
You should NEVER add extension directive in php.ini

Ex:

$ rpm -ql php-imap
/usr/lib64/php/modules/imap.so
...
/etc/php.d/20-imap.ini
...

I heartily recommend you restore the default php.ini provided in the package.

mv /etc/php.ini /etc/php.ini.save
yum reinstall php-common
Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

3 (edited by ggraziella 2020-04-30 14:38:10)

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

Hello,

thank you for replying so quickly.

I searched for the remi default installed packages list but could not find it and because with the php-* line I still had the issues, I thought more directives (php74-* and in php.ini) would work..

I started with the installation wizard instructions before tweacking them a little because always got this message at the 3rd step:
[root@centos-7-x64-virtualbox ~]# sudo yum install yum-utils
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel/x86_64/metalink                    100% [==============================]  0.0 B/s |  28 kB  --:--:-- ETA epel/x86_64/metalink                                                                   |  28 kB  00:00:00

* epel: epel.mirror.far.fi
* remi-safe: fr2.rpmfind.net
acacia-main                                                                            | 2.6 kB  00:00:00

awl-external                                                                           | 2.6 kB  00:00:00

awl-main                                                                               | 2.6 kB  00:00:00

mysql-connectors-community                                                             | 2.5 kB  00:00:00

mysql-tools-community                                                                  | 2.5 kB  00:00:00

mysql56-community                                                                      | 2.5 kB  00:00:00

puppet                                                                                 | 2.6 kB  00:00:00

puppet-dependencies                                                                    | 2.6 kB  00:00:00

remi-safe                                                                              | 3.0 kB  00:00:00

secure-main                                                                            | 2.5 kB  00:00:00

sysdev-main                                                                            | 2.6 kB  00:00:00

Nothing to do

That is why at the 4th step, I use sudo yum -y install --enablerepo=remi-php74 php php-cli php php-opcache php-gd php-curl php-mysqlnd php-common php-fpm php-mysql php-mbstring php-mcrypt php-xml php-pecl-apc php-pear php-pdo
instead of
yum-config-manager --enable remi-php74

But  just found out yum-config-manager is available by default so I am following the proper installation right now.

In the other hand,I try to restore php.ini which shows:
[root@centos-7-x64-virtualbox ~]# mv /etc/php.ini /etc/php.ini.save
[root@centos-7-x64-virtualbox ~]# sudo yum reinstall php-common
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: epel.mirror.far.fi
* remi-safe: fr2.rpmfind.net
Installed package php-common-7.4.5-1.el7.remi.x86_64 (from remi-php74) not available.
Error: Nothing to do

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

> Installed package php-common-7.4.5-1.el7.remi.x86_64 (from remi-php74) not available.

"remi-php74" repository is not enabled.

Again, follow "carrefully" the wizard instructions.

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

Hello again smile

following the installation wizard skipping the 3rd step, I finally got:
[root@centos-7-x64-virtualbox ~]$ php -v

PHP 7.4.5 (cli) (built: Apr 14 2020 12:54:33) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies
without warnings.

Thank you so much for explaining me about the php* differences and your advisory not to tweak the php.ini file (unless I need an extension like the php-soap one?).
Regards

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

no you never have to edit php.ini

even php-soap, like ALL packages, provides its own configuration file

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

7 (edited by ggraziella 2020-04-30 16:09:35)

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

Okay copy that!

Thanks a lot. How can one mark this topic as solved?

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

and if you need to add some options, create a dedicated file such as
/etc/php.d/my_settings.ini

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

Oh okay, it will be "automagically" read by remi php?

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

this is a default php behavior: all ini files in /etc/php.d are read

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Many PHP 7.4.5 Unable to load dynamic library after installation

Okay smile