Percona with cPanel: libmysqlclient.so.18: cannot open shared object file

A recent Percona upgrade caused problems with PHP on some cPanel servers. The name of the libmysqlclient library was changed without keeping a symlink to the original name, which caused PHP to throw errors, and EasyApache not compiling successfully.

Running php -v will show it…

php -v
php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

From the Percona Server 5.5.36-34.0 Release Notes: https://my.fusioned.net/knowledgebase/10100/Percona-with-cPanel-libmysqlclientso18-cannot-open-shared-object-file.html

In order to comply with Linux distribution packaging standards Percona‘s version of libmysqlclient has been renamed to libperconaserver. The old name was conflicting with the upstream libmysqlclient. Except for packaging, libmysqlclient and libperconaserverclient of the same version do not have any differences. Users wishing to continue using libmysqlclient will have to install the corresponding package of their distribution, such as mysql-lib for CentOS and libmysqlclient18 for Ubuntu/Debian. Users wishing to build software against libperconaserverclient should install libperconaserverclient-dev package. An old version of Percona-built libmysqlclient will be available for download.

You simply need to symlink libperconaserver to libmysqlclient, and here’s how it’s done:


# ln -s /usr/lib64/libperconaserverclient.so /usr/lib64/libmysqlclient.so
# ln -s /usr/lib64/libperconaserverclient.so.18 /usr/lib64/libmysqlclient.so.18

(Note: for RHEL/CentoOS/CL 6 x86, replace /usr/lib64 with /usr/lib)

Finally, re-run EasyApache to compile PHP against the new libraries:


# /scripts/easyapache --build

Note: After running this, this error appeared on php sites…


ERROR: Database Error: The MySQL adapter "mysql" is not available.

Checked and the symlinks were not real as there were missing files.

Check perconal rpm’s

rpm -qa |grep PerconaPercona-Server-shared-compat-5.5.35-rel33.0.611.rhel5
Percona-Server-shared-56-5.6.16-rel64.0.el5
Percona-Server-client-56-5.6.16-rel64.0.el5
Percona-Server-devel-56-5.6.16-rel64.0.el5
Percona-Server-server-56-5.6.16-rel64.0.el5

I removed the symlinks and applied

Removed the symlinks and then followed this cpanel article symlink at the bottom to rebuild.

Another resource:
https://documentation.cpanel.net/display/CKB/How+to+Replace+MySQL+with+Percona

Cpanel Documentation
https://documentation.cpanel.net/display/CKB/How+to+Update+a+Percona+Installation

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.