我正在为.php和.html文件创建一个虚拟处理程序helloworld.处理程序包含:
static int helloworld_handler(request_rec *r){
ap_rprintf(r, "hello world!");
return OK;
}
Run Code Online (Sandbox Code Playgroud)
我在apache2.conf中得到了这个:
<Directory /var/www/html>
AddHandler helloworld .php .html
</Directory>
Run Code Online (Sandbox Code Playgroud)
处理程序"helloworld"适用于.html文件,但它不适用于.php文件.我认为这主要是因为默认的PHP处理程序会覆盖.php文件的helloworld处理程序.如何使"helloworld"处理程序适用于.php文件?
如果需要任何额外信息,请询问.