加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ubuntu – 在stderr中发送的FastCGI:无法打开主脚本

发布时间:2020-12-13 21:11:15 所属栏目:Nginx 来源:网络整理
导读:情况: 服务器A服务器B安装了相同的Ubuntu 14.04,相同的nginx版本(1.4.6),相同的虚拟主机(domain.com)和joomla文件夹(rsync-ed从服务器A到B) 但是服务器A只能显示其首页,并且会在任何菜单项上显示“未指定文件输入”. 如果我在/ etc / hosts中更改服务器A的I

情况:

服务器A&服务器B安装了相同的Ubuntu 14.04,相同的nginx版本(1.4.6),相同的虚拟主机(domain.com)和joomla文件夹(rsync-ed从服务器A到B)

但是服务器A只能显示其首页,并且会在任何菜单项上显示“未指定文件输入”.

如果我在/ etc / hosts中更改服务器A的IP将在服务器B测试后使用domain.com,则它不会立即失败.只有几分钟后才会出现错误.

nginx的错误日志上有一些消息,如下所示:

2015/02/23 12:01:57 [error] 15515#0: *260609 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined property: JPagination::$pagesTotal in /var/www/joomla/templates/ashton/html/com_content/featured/default.php on line 76" while reading response header from upstream,client: 10.224.202.152,server: www.domain.com,request: "GET / HTTP/1.1",upstream: "fastcgi://unix:/var/run/php5-fpm.sock:",host: "www.domain.com" 
最佳答案
通过添加“fastcgi_param SCRIPT_FILENAME”解决了这个问题

示例如下

server {
    listen 80;
    root /var/www/joomla;
    index index.php index.html index.htm;
    server_name www.domain.com;

    location / {
        try_files $uri $uri/ /index.php?q=$request_uri;
    }

    location ~ .php${
        fastcgi_split_path_info ^(.+.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读