I have installed PHP, MySQL, Apache on CentOS 6, now I have restarted the Apache and mysql, to test PHP I have created a index.php
on /var/www/html/test/
now once I go to localhost/test/index.php
then it shows only PHP source code like this:
From Gnouc comment, I understand that it is due to SELinux security layer.
To work with HTML directory i did this in my terminal, but still i have the same result:
[root@localhost www]# chcon -v --type=httpd_sys_content_t html
changing security context of `html`
Any idea?
SELinux
enable?SELinux
is enable, you should check if it allow cgi script to execute and make sure ownership of php file, and allow it executable.