【问题标题】:How to enable ForceType in Apache with mod_fcgid如何使用 mod_fcgid 在 Apache 中启用 ForceType
【发布时间】:2012-12-13 20:21:03
【问题描述】:

我有 mod_spdy,所以我必须为 PHP per instructions from Google 启用 mod_fcgid。配置如下:

<Location />
AddHandler fcgid-script .php
Options +ExecCGI
FcgidWrapper /usr/bin/php-cgi .php
</Location>

但是,现在ForceType application/x-httpd-php 不起作用。

这是我以前的:

<FilesMatch (index.html|foo|bar)>
ForceType application/x-httpd-php
</FilesMatch>

但它现在被忽略了——即 PHP 正在呈现而不是预处理。以下是发生的事情:

$ curl -i http://blahblah.ca/
HTTP/1.1 200 OK
Date: Fri, 28 Dec 2012 15:19:22 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Wed, 07 Apr 2010 20:49:57 GMT
ETag: "494bb1-676-483abb4742740"
Accept-Ranges: bytes
Content-Length: 1654
Vary: Accept-Encoding
Content-Type: application/x-httpd-php

如何让 ForceType 与 mod_fcgid 一起使用?

【问题讨论】:

  • 试试SetHandler而不是ForceType
  • SetHandler application/x-httpd-php?没有运气。
  • 不,SetHandler fcgid-script,它可能会起作用。
  • 我最终遇到两个错误:(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://blah/Premature end of script headers: about, referer: http://blah/
  • 嗯,至少这是一个改进。不幸的是,我们现在已经用尽了我的 FastCGI 经验。

标签: php apache fastcgi mod-fcgid


【解决方案1】:

试试这个

<FilesMatch (index.html|foo|bar)>
  SetHandler fcgid-script
  FCGIWrapper /usr/bin/php-cgi
</FilesMatch>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-28
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    相关资源
    最近更新 更多