php 集成环境http_config html语法配置支持include包含步骤

1:加载ssi模块。因为ssi是apache中的一个模块服务项,要使用ssi功能,我们首先要对ssi模块进行加载,打开apache的配置文件httpd.conf。找到 LoadModule ssl_module modules/mod_ssl.so 命令,因该服务未被默认加载,所以只需取消该命令前的注释符#即可开启

2:添加你需要的文件类型,因为使用ssi技术的默认文件名为.shtml,所以我们需要在配置文件中对.shtml后缀名进行设置,并按自己的需求设置需要对ssi技术进行解析的文件类型设置。同样在httpd.conf文件中找到如下两行代码:

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

改为:

AddType text/html .shtml .html .htm

AddOutputFilter INCLUDES .shtml .html .htm

3:在httpd.conf文件中查找“Options +Indexes +FollowSymLinks +ExecCGI” 在后面加上INCLUDES,需要注意的是,ssi可以利用shell来执行命令,因此这个功能是有危险的,它会执行任何包含在exec标记中的命令,如果你的用户有权限修改你的网页内容,建议把该功能关闭。当然你还可以加上IncludesNOEXEC参数,来关闭exec功能,同时又保留SSI。此时改为: Options +Indexes +FollowSymLinks +ExecCGI +INCLUDES +IncludesNOEXEC

4:如果报错[an error occurred while processing this directive]

    Options +Indexes +FollowSymLinks +ExecCGI +INCLUDES +IncludesNOEXEC

    AllowOverride All

    Order allow,deny

    Allow from all

    Require all granted

    SSILegacyExprParser on    << 这一句加上

你可能感兴趣的:(php 集成环境http_config html语法配置支持include包含步骤)