【问题标题】:.htaccess - execute PHP in .html files on FastCGI.htaccess - 在 FastCGI 上的 .html 文件中执行 PHP
【发布时间】:2016-10-27 08:18:09
【问题描述】:

我将 PHP 与 FastCGI 一起使用,但遇到以下问题。我知道 .htaccess 的命令:

AddHandler fcgid-script .html
FcgidWrapper /path/to/php-fastcgi.fcgi .html

...但我不知道FcgidWrapper 应该指向什么路径。它应该指向哪个文件或目录,通常在哪里?

谢谢!

【问题讨论】:

标签: php html .htaccess server fastcgi


【解决方案1】:

您要求的路径取决于系统,因此只有您的系统管理员才能回答该问题。您可能应该只使用 php 重命名您的 html 文件以使用 php 扩展名。将没有 php 的 html 文件发送到 fcgi 是一种浪费。

【讨论】:

    【解决方案2】:

    你可以试试这个

    <IfModule mod_fcgid.c>
    <Files ~ (\.html)>
        SetHandler fcgid-script
        FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
        Options +ExecCGI
        allow from all
    </Files>
    

    【讨论】:

      猜你喜欢
      • 2019-12-26
      • 2018-12-20
      • 1970-01-01
      • 2021-06-06
      • 1970-01-01
      • 2019-04-02
      • 1970-01-01
      • 2013-12-14
      • 1970-01-01
      相关资源
      最近更新 更多