1.yum安装php
yum install php
2.配置 apache 支持 php
a.找到httpd.conf
find / -name httpd.conf
b.编辑 httpd.conf
vi httpd.conf
c.找到 AddType application/x-gzip .gz .tgz 在其下添加两行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
3.重启apache
service httpd restart