Skip to content


apache关闭某目录的PHP解析

可以在http.conf的目录区域增加”php_flag engine”参数,关闭对某个目录的php解析,起到保护的作用。



    DocumentRoot /opt/htdocs/www
    ServerName local.c1gstudio.com


    php_flag engine Off
    AddOutputFilterByType DEFLATE text/html text/plain text/xml

 

关闭后php文件将会变成可下载的纯文本文件,所以请小心使用。

Posted in Apache, PHP, 技术.

Tagged with , .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.