解决error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
今天给公司服务器编译完php后,打算启动php-fpm的时候,居然给我报:error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory这个错误,我的mysql是二进制包,位置是/usr/local/mysql下,然后我看了下/usr/local/mysql/lib/下是有libmysqlclient.so.18这个文件的.
解决办法:
1.先确认/usr/local/mysql/lib/下是否有libmysqlclient.so.18这个文件.
ll /usr/local/mysql/lib/|grep libmysqlclient.so.18
2.修改ld.so.conf文件
echo "/usr/local/mysql/lib" >>/etc/ld.so.conf
然后执行ldconfig使其生效.
解决办法:
1.先确认/usr/local/mysql/lib/下是否有libmysqlclient.so.18这个文件.
ll /usr/local/mysql/lib/|grep libmysqlclient.so.18
2.修改ld.so.conf文件
echo "/usr/local/mysql/lib" >>/etc/ld.so.conf
然后执行ldconfig使其生效.
评论: