[英]PHP: error while loading shared libraries: libmysqlclient.so.18
I'm Set Crontab : 我设置了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)
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 谢谢大家
Php is compiled against the wrong mysql lib. PHP是针对错误的mysql lib编译的。
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
A better option is remove your php and install the version 5.3.23: 更好的选择是删除您的php并安装5.3.23版本:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.