1.确保mod_include.so 前面的注释去掉
LoadModule include_module libexec/apache2/mod_include.so
2. 取消注释: AddOutputFilter INCLUDES .html
3.添加IncludesNOEXEC
Options Indexes FollowSymLinks IncludesNOEXEC
4.重启服务
则<!--#include virtual="sub.html" --> include 引入页面可以显示
另外一种include 是php的include <?php include("sub.html")?>
需要设置apache 支持include
操作步骤:
1.下载php 并解压缩到 d:\php
2.php.ini-dist -- php.ini
3. apache的配置文件 LoadModule php5_module D:/php/php5apache2.dll 取消注释
4.PHPIniDir "D:/php"
5.AddType application/x-httpd-php .html
重启服务