Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I first installed php5.5 and mysql5.6 then due to some pacakge problem i had to remove them and install php5.3 and mysql 5.1 from yum.

I php is not detecting any extensions and giving me this error

[root@ipserver etc]# php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]

I do have files in that directory and they have read permissions

[root@ipserver etc]# php --ini
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      /etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo_mysql.ini

EDIT:

I tried copy only mysql.so file somewhere else and harcode in php.ini

extension=/etc/mysql.so

i get this

PHP Warning:  PHP Startup: Unable to load dynamic library '/etc/mysql.so' - libmysqlclient.so.16: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      (none)
share|improve this question

2 Answers 2

Run

 ldconfig

This made the Dynamic Linker Run Time Bindings reread the

/etc/ld.so.conf.d

directory for new library directories.

share|improve this answer
    
i tried but same error –  JohnK Jul 6 '13 at 8:11

You're missing the MySQL client libary, not the MySQL library itself. The error is complaining about: libmysqlclient.so.16

Try installing the mysql-libs package. If you've already installed it, try reinstalling. libmysqlclient.so.16 appears to be part of it.

Where did you get the MySQL packages from that failed to install? You might have to clean out some config files before everything works together again, since the newer versions of things might have overwritten older configs, and just reinstalling the older packages might not overwrite them.

Edit: Saw that you tagged it CentOS and removed my comment :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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