Normally this happens when you upgrade the version of Cpanel.
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 will not receive phpMyAdmin “500 internal server error”.