This happens when you upgrade the version of Cpanel/WHM.
1. Check the permissions for files as follows:
/usr/local/cpanel/3rdparty/bin/php
/usr/local/cpanel/3rdparty/bin/php-cgi
2. Above files should have 755 permissions. If not then change the permission to 755.
3. Once the permissions are changed, execute the below command from shell
# /scripts/makecpphp
Now you should not receive a phpMyAdmin 500 Internal Server Error.