WHM/cPanel generates a 500 error when accessing phpMyAdmin, WP Toolkit, or Roundcube Webmail, including one of the following error message in the cPanel error logs:
cpanel_php_fpm libldap_r-2.4.so.2: cannot open shared object file: No such file or directory
/usr/local/cpanel/3rdparty/bin/php-cgi: error while loading shared libraries: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory
restartsrv_cpanel_php_fpm: /usr/local/cpanel/3rdparty/sbin/cpanel_php_fpm: error while loading shared lib
This error indicates that the package openldap-compat is missing from your server. This package is usually installed with the operating system and is a package that cPanel requires but does not install on its own. Some RHEL-based server images may not come with this package pre-installed.
Install the package with your package manager:
dnf install openldap-compat