加载共享库时出错:libmysqlclient.so.18

时间:2021-03-22 13:27:35

I'm Set Crontab :

我设置定时任务:

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

But Not Execute PHP code!

但是不要执行PHP代码!

[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

我正在使用Centos和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)

3 个解决方案

#1


5  

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

工作做得很好:D

Thanks All

感谢所有

#2


1  

Php is compiled against the wrong mysql lib.

Php是针对错误的mysql库编译的。

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

我建议您检查php可执行文件是否是rpm包提供的。

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

您还可以尝试一个不干净的工作区,转到libmysqlclient.so的目录。16定位和书写:

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

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

#3


0  

A better option is remove your php and install the version 5.3.23:

更好的选择是删除php并安装5.3.23版本:

  1. yum remove php
  2. 百胜将php
  3. wget http://repo.webtatic.com/yum/centos/5/latest.rpm
  4. wget http://repo.webtatic.com/yum/centos/5/latest.rpm
  5. rpm -ivh latest.rpm
  6. rpm -ivh latest.rpm
  7. enable the webtatic repository and disable the rhea repository (/etc/yum.repos.d/)
  8. 启用web存储库并禁用rhea存储库(/etc/yum.repo .d/)
  9. yum install php
  10. yum安装php

#1


5  

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

工作做得很好:D

Thanks All

感谢所有

#2


1  

Php is compiled against the wrong mysql lib.

Php是针对错误的mysql库编译的。

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

我建议您检查php可执行文件是否是rpm包提供的。

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

您还可以尝试一个不干净的工作区,转到libmysqlclient.so的目录。16定位和书写:

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

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

#3


0  

A better option is remove your php and install the version 5.3.23:

更好的选择是删除php并安装5.3.23版本:

  1. yum remove php
  2. 百胜将php
  3. wget http://repo.webtatic.com/yum/centos/5/latest.rpm
  4. wget http://repo.webtatic.com/yum/centos/5/latest.rpm
  5. rpm -ivh latest.rpm
  6. rpm -ivh latest.rpm
  7. enable the webtatic repository and disable the rhea repository (/etc/yum.repos.d/)
  8. 启用web存储库并禁用rhea存储库(/etc/yum.repo .d/)
  9. yum install php
  10. yum安装php