Apache 2.4下配置Apache和PHP,使之协同工作

1、修改httpd的主配置文件httpd.conf,搜索ServerName
#ServerName www.example.com:80
修改为:
ServerName www.example.com:80

2、找到如下内容:
<Directory />
AllowOverride none
Require all denied
</Directory>
修改为:
<Directory />
AllowOverride none
Require all granted
</Directory>

3、找到AddType application/x-gzip /gz .tgz
在该行下面添加一行:
AddType application/x-httpd-php .php

4、找到如下内容:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
将该行修改为:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

5、find / -name libphp5.so
在httpd.conf 配置
LoadModule php5_module /你的路径/libphp5.so
原文地址:https://www.cnblogs.com/peteremperor/p/10857208.html