A lot of tutorials say to disable selinux. This is dumb. here is how you configure it to let you serve php files.
first make sure it is actually selinuxecho 0 > /selinux/enforce
This disables selinux so now let us see if the pages serve up now.
Next if the pages serve fine with selinux disable, see what the policy is currently set on the directoryls -Z
Also, you can check here to see if it is selinux that is keeping apache from executing the php filestail /var/log/audit/audit.log
Next, we need to install some things to configure selinuxyum -y install policycoreutils-python
Next, lets configure it to work with the default directorysemanage fcontext -a -t httpd_sys_script_exec_t '/var/www/html/(/.*)?'
restorecon -R -v /var/www/html/
See if it changed the polcyls -Z
Re-enable selinuxecho 1 > /selinux/enforce