我已经安装了PHP,MySQL和Apache的在CentOS 6,现在我已经重新启动Apache和MySQL,以测试PHP我创建了一个index.php在/var/www/html/test/现在一次我去localhost/test/index.php那么就说明这样才PHP源代码:

从 Gnouc 评论中,我了解到这是由于 SELinux 安全层。
为了使用 HTML 目录,我在终端中执行了此操作,但结果仍然相同:
[root@localhost www]# chcon -v --type=httpd_sys_content_t html
changing security context of `html`
Run Code Online (Sandbox Code Playgroud)
任何的想法?