Symptoms
PHPMyAdmin cannot load for WHM and cPanel, and the cPanel error log shows a "Cannot Open Source Device."
Description
When getting a 500 error when accessing PHPMyAdmin, you may find the following error in the cPanel error log at /usr/local/cpanel/logs/error_log
PHP Fatal error: Uncaught Exception: Cannot open source device in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/classes/Session.php:200
This error happens due to the /dev not having the right permissions, so non-root users cannot access it. This can be checked to see if anything is different than the default on /dev's permissions which is 755:
# stat /dev
File: '/dev'
Size: 2740 Blocks: 0 IO Block: 4096 directory
Device: 5h/5d Inode: 1025 Links: 18
Access: (0640/drw-r-----) Uid: ( 0/ root) Gid: ( 12/ mail)
Context: system_u:object_r:device_t:s0
Access: 2021-03-08 15:33:55.733487193 +0000
Modify: 2021-02-28 09:01:09.709923776 +0000
Change: 2021-03-31 03:21:32.406397720 +0000
Birth: -
Workaround
To fix this, you will need to go through and update the permission for /dev back to 755 by using the chmod command. An example command of this can be used like this:
chmod 755 /dev