PHP: error while loading shared libraries: libmysqlclient.so.18

31,912

Solution 1

code:

#ls -l /usr/lib/mysql | grep libmysqlclient.so

outPut:

lrwxrwxrwx 1 root root      24 Dec 21 21:41 libmysqlclient.so -> libmysqlclient.so.16.0.0
lrwxrwxrwx 1 root root      24 Dec 21 21:41 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
-rwxr-xr-x 1 root root 1524000 Dec  7 18:27 libmysqlclient.so.16.0.0

#ln /usr/lib/mysql/libmysqlclient.so.16.0.0  /usr/lib/mysql/libmysqlclient.so.18

Not Work !

But :

#ln /usr/lib/mysql/libmysqlclient.so.16.0.0  /usr/lib/libmysqlclient.so.18

It's Work very Good :D

Thanks All

Solution 2

Php is compiled against the wrong mysql lib.

I suggest you to check if the php executable is the one provided with the rpm package.

You can also try a dirty workaround, go to the directory where the libmysqlclient.so.16 is located and write:

ln -s libmysqlclient.so.16 libmysqlclient.so.18

Share:
31,912
Ali ZahediGol
Author by

Ali ZahediGol

Updated on July 09, 2022

Comments

  • Ali ZahediGol
    Ali ZahediGol almost 2 years

    I'm Set Crontab :

    [root@root mysql]# crontab -l
    5 *  *  *  *  php /home/admin/public_html/scheduleSendMail.php
    

    But Not Execute PHP code!

    [root@root mysql]# php /home/admin/public_html/scheduleSendMail.php 
    php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
    
    
    [root@root mysql]# rpm -qR postfix
    

    find :

    ..
    libmysqlclient.so.16  
    libmysqlclient.so.16(libmysqlclient_16)  
    ..
    

    I am using the Centos And DirectAdmin

    PHP v: php-5.3.3-14.el6_3.i686
    mysql v: mysql-5.1.66-2.el6_3.i686
    centos v: CentOS release 6.3 (Final)
    
  • Ali ZahediGol
    Ali ZahediGol over 11 years
    MerC. But Can not even see my version php.#php -v --> Error libmysqlclient.so.18: cannot open....I've done something that you said But Not work.