A PHP website is showing error 500 and /var/log/apache2/error_log reports "failed to open stream: Permission denied in".
The file being accessed while using CGI is strict because the file permissions may be set to 640 which means it's only readable as the user.
ls -al /home/someuser/public_html/wp-config.php
-rw-r----- 1 someuser someuser 3612 May 26 21:22 /home/someuser/public_html/wp-config.php
Without suexec or ruid2 the Apache error_log will report the following when trying to load the site:
AH01215: PHP Fatal error: require_once(): Failed opening required '/home/someuser/public_html/wp-config.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/someuser/public_html/wp-load.php on line 37: /usr/local/cpanel/cgi-sys/ea-php74, referer: https://someuserssite.com/
An Apache module of either mod_suexec or mod_ruid2 needs to be installed.
mod_suexec can be installed with:
yum install ea-apache24-mod_suexec
mod_ruid2 can be installed with
yum install ea-apache24-mod_ruid2
We have more information on mod_ruid2 and mod_suexec at: