【问题标题】:Fastcgi params configuring owncloud with nginx使用 nginx 配置 owncloud 的 Fastcgi 参数
【发布时间】:2021-12-19 10:45:15
【问题描述】:

所以有a site,我正在配置我的 Ubuntu 服务器。大约 2 年前我做过一次,但从那以后发生了很多变化。比如现在有php8.0,owncloud还不支持。无论如何,我有 php7.4,我正在尝试配置我的 /etc/nginx/sites-available/mydomainname.com 配置文件(当然是我的真实域名),但我无法让它工作。我已经尝试了很多 fastcgi 参数示例,但都没有奏效。 The site I mentioned has also an example 它在 2 年前有效,但现在无效。我得到同样的错误:FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream.

有人可以帮我吗?这个配置有什么问题?

location ~ [^/].php(/|$) {
        fastcgi_split_path_info ^(.+?.php)(/.*)$;
        fastcgi_pass unix:/var/run/php7.4-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

【问题讨论】:

  • "Primary script unknown" 表示 SCRIPT_FILENAME 的值不指向 PHP 可以读取的文件。检查您的fastcgi_params 文件,以及由该location 继承的root 指令的值。
  • 非常感谢。我需要输入这条线,现在它可以工作了fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

标签: ubuntu nginx fastcgi owncloud


【解决方案1】:

如果有一天有人需要这个,我会发现问题。我检查了 /etc/nginx/ 中的 fastcgi_params 文件,但没有看到缺少一行。这: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 感谢 Richard Smith 的帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-19
    • 1970-01-01
    • 1970-01-01
    • 2012-06-06
    • 1970-01-01
    • 2011-12-02
    相关资源
    最近更新 更多