PHP 7.2 error.

Issues related to applications and software problems
hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

PHP 7.2 error.

Post by hack3rcon » 2019/05/20 05:56:31

Hello.
I installed PHP 7.2 on CentOS 7.6 x86_64, but when I type "php -v" or "php72" then it show me below error:

Code: Select all

$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.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: /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.18 (cli) (built: Apr 30 2019 14:41:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

$ php72
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo.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: /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory), /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Any idea to solve it?

Thank you.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP 7.2 error.

Post by remirepo » 2019/05/20 06:45:55

Better to ask on dedicated forum: https://forum.remirepo.net/

Code: Select all

rpm -qa 'php*'
rpm --verify php72-php-pdo php72-php-mysqlnd
Remi's Repository - Forum - Blog

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: PHP 7.2 error.

Post by hack3rcon » 2019/05/20 07:15:58

remirepo wrote:
2019/05/20 06:45:55
Better to ask on dedicated forum: https://forum.remirepo.net/

Code: Select all

rpm -qa 'php*'
rpm --verify php72-php-pdo php72-php-mysqlnd
Result are:

Code: Select all

$ rpm -qa 'php*'
php-common-7.3.5-1.el7.remi.x86_64
php72-php-cli-7.2.18-1.el7.remi.x86_64
php72-runtime-2.0-1.el7.remi.x86_64
php72-2.0-1.el7.remi.x86_64
php-pdo-7.3.5-1.el7.remi.x86_64
php72-php-json-7.2.18-1.el7.remi.x86_64
php72-php-xml-7.2.18-1.el7.remi.x86_64
php-mysqlnd-7.3.5-1.el7.remi.x86_64
php72-php-common-7.2.18-1.el7.remi.x86_64
php72-php-pdo-7.2.18-1.el7.remi.x86_64
php-json-7.3.5-1.el7.remi.x86_64
And:

Code: Select all

$ rpm --verify php72-php-pdo php72-php-mysqlnd
$ 
But:

Code: Select all

$ php
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/remi/php72/root/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' already loaded in Unknown on line 0
And:

Code: Select all

$ sudo find / -name pdo_mysql.so -print
/usr/lib64/php/modules/pdo_mysql.so
/usr/lib64/php-zts/modules/pdo_mysql.so
/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so
How can I solve it?

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP 7.2 error.

Post by remirepo » 2019/05/20 07:36:53

Looks like you have added some lines in your php.ini to load the extensions which is never needed (each package provides a dedicated configuration file to load the provided extensions, in the right order)

> PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql.so'

Must be loaded after PDO and after MySQLnd

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

Load twice

So the packages comes with

Code: Select all

20-mysqlnd.ini
20-pdo.ini
30-pdo_mysql.ini
Which ensure the correct load order


Notice: you also have 2 php stack installed (php-* 7.3.5 and php72-php-* 7.2.18) is thist wanted ?

Please read: https://blog.remirepo.net/pages/English-FAQ#scl and follow the Wizard instructions https://rpms.remirepo.net/wizard/
Remi's Repository - Forum - Blog

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: PHP 7.2 error.

Post by hack3rcon » 2019/05/20 08:03:42

Thank you. I removed PHP 7.3:

Code: Select all

$ rpm -qa 'php*'
php72-php-cli-7.2.18-1.el7.remi.x86_64
php72-php-mysqlnd-7.2.18-1.el7.remi.x86_64
php72-runtime-2.0-1.el7.remi.x86_64
php72-2.0-1.el7.remi.x86_64
php72-php-json-7.2.18-1.el7.remi.x86_64
php72-php-xml-7.2.18-1.el7.remi.x86_64
php72-php-common-7.2.18-1.el7.remi.x86_64
php72-php-pdo-7.2.18-1.el7.remi.x86_64
And:

Code: Select all

$ php phpinfo.php | grep php.ini
Configuration File (php.ini) Path => /etc/opt/remi/php72
Loaded Configuration File => /etc/opt/remi/php72/php.ini
"locate" command give me more result:

Code: Select all

$ locate php.ini
/etc/php.ini.rpmsave
/etc/opt/remi/php72/php.ini
/opt/remi/php72/root/usr/share/doc/php72-php-common-7.2.18/php.ini-development
/opt/remi/php72/root/usr/share/doc/php72-php-common-7.2.18/php.ini-production
In "/etc/opt/remi/php72/php.ini" I just added those lines but:

Code: Select all

$ php72
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so (/opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /opt/remi/php72/root/usr/lib64/php/modules/pdo_mysql.so.so (/opt/remi/php72/root/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' already loaded in Unknown on line 0
What's happened?
Last edited by hack3rcon on 2019/05/20 08:06:18, edited 1 time in total.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP 7.2 error.

Post by remirepo » 2019/05/20 08:05:43

Code: Select all

rpm --verify --all php72\*
> In "/etc/opt/remi/php72/php.ini" I just added those lines but:

As explained previously, you don't have to change any ini file
Remi's Repository - Forum - Blog

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: PHP 7.2 error.

Post by hack3rcon » 2019/05/20 08:07:08

remirepo wrote:
2019/05/20 08:05:43

Code: Select all

rpm --verify --all php72\*
Result is:

Code: Select all

$ rpm --verify --all php72\*
S.5....T.  c /etc/opt/remi/php72/php.ini

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP 7.2 error.

Post by remirepo » 2019/05/20 08:10:15

So revert back to the default provided php.ini
Remi's Repository - Forum - Blog

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: PHP 7.2 error.

Post by hack3rcon » 2019/05/20 08:33:27

remirepo wrote:
2019/05/20 08:10:15
So revert back to the default provided php.ini
How?

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: PHP 7.2 error.

Post by remirepo » 2019/05/20 08:43:50

remove your change or remove the php.ini and reinstall php72-php-common which provides it.
Remi's Repository - Forum - Blog

Post Reply