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.
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:
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.

The solution is pretty easy; 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
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Munin: MySQL InnoDB free tablespace WARN

Because of the fact that Munin by default throws a warning at 2GB free tablespace and a critical...

Munin: Apache monitoring after nginxcp install

If you installed nginxcp to boost your cPanel server performance, then you might have noticed...

Munin: Fix MySQL graphs not updating

If you have setup munin-node on a cPanel server it's possible that your MySQL graphs stop...

Access Key

Before we can access your server you must first install our SSH public key. You must do the...

Public SSH key

Before we can log into your server, please add the following to your authorized_keysfile:...