You don't write, what webserver do you use. I assume it is Apache running on RHEL5
First, you must check, if php module is installed and loaded into apache and properly configured.
You wrote, that apache return files intead of executing them. This is default action for apache if apache doesn't know, what to do with special file type. In default RHEL apache config, php is loaded from file /etc/httpd/conf.d/php.conf
and file /etc/httpd/conf/httpd.conf
contains line Include conf.d/*.conf
, which includes all files from conf.d
dir. These lines from php.conf
should be uncommented:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php
Second, you must check, if SELinux protection doesn't deny any requests. If SELinux deny access to some files from apache, you will se 403 Forbidden
error in your browser. In /var/log/audit/audit.log
you will se some avc: denied
messages. You should read man httpd_selinux
manpage. Files from directory /var/www/vhosts/default/httpsdocs
should be labeled with httpd_sys_content_t
label (you should execute chcon -R -t httpd_sys_content_t
). To make this change premament (to survice filestytem relabel), you should execute also semanage fcontext -a -t httpd_sys_content_t /var/www/vhosts/default/httpsdocs(/.*)?