gpt4 book ai didi

php - AddType application/x-httpd-php .php 不呈现 PHP

转载 作者:行者123 更新时间:2023-12-04 23:27:31 26 4
gpt4 key购买 nike

添加此代码:
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

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

    关于php - AddType application/x-httpd-php .php 不呈现 PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45773440/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com