添加此代码:
AddType application/x-httpd-php .php 后
...
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
Run Code Online (Sandbox Code Playgroud)
要
C:\Apache24\bin\httpd.conf
下载我的系统上的所有PHP页面,而不是渲染。
在此之前,PHP 页面被解析为原始文本。
需要帮助!
有两个问题:
application/x-httpd-php不是 MIME 类型,而是处理程序。这意味着您的指令必须是AddHandler而不是AddType
application/x-httpd-php不是有效的处理程序。处理程序必须在字符串末尾包含 PHP 版本数字
总而言之,假设 PHP 7.2 版,你想要的是
? AddHandler application/x-httpd-php72 .php代替
AddType application/x-httpd-php .php