This Video will show you how to solve the error: unable to open primary script permission denied on Centos 8.
In this video i was trying to install moodle and when i went to access the site, I kept getting an error. In the Apache logs i could see the error: unable to open primary script: ‘Unable to open primary script varwwwhtmlmoodleindex.php (Permission denied)
When i delved into the error i could see that it was selinux was causing the issue.
You can disable selinux on the fly by entering: sudo setenforce 0
but to permanently disable you should edit the/etc/selinux/config file and
set selinux to disabled SELINUX=disabled