httpd不支持php,httpd php不解析怎么办

httpd php不解析的解决办法:首先找到“AddType application/x-gzip .gz .tgz”;然后添加内容为“AddType application/x-httpd-php .php”并保存即可。

be8b27633f51b5b86491676f720aa90a.png

apache 不解析php

对apache的参数,还是不够理解。

1.找到:AddType application/x-gzip .gz .tgz

在其下面添加:AddType application/x-httpd-php .php //添加支持对php脚本解析

2. 找到:

DirectoryIndex index.html

把中间那一行改为:DirectoryIndex index.html index.htm index.php //增加对php的索引

正常了。

另外,PHP编译的时候,要调用apache这个模块, --with-apxs2=/usr/local/apache2/bin/apxs