AddHandler不适用于.php文件 – Apache 2.4

前端之家收集整理的这篇文章主要介绍了AddHandler不适用于.php文件 – Apache 2.4前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在为.PHP和.html文件创建一个名为helloworld的虚拟处理程序.处理程序包含:
static int helloworld_handler(request_rec *r){
    ap_rprintf(r,"hello world!");
    return OK;
}

我在apache2.conf中得到了这个:

<Directory /var/www/html>
AddHandler helloworld .PHP .html
</Directory>

处理程序“helloworld”适用于.html文件,但它不适用于.PHP文件.我认为这主要是因为默认的PHP处理程序会覆盖.PHP文件的helloworld处理程序.如何使“helloworld”处理程序适用于.PHP文件

如果需要任何额外信息,请询问.

您可能想要尝试 SetHandler
<FilesMatch \.PHP$>
    SetHandler helloworld
</FilesMatch>
原文链接:https://www.f2er.com/php/137311.html

猜你在找的PHP相关文章