解决nginx错误 [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 ups

Published on Aug. 22, 2023, 12:11 p.m.

[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”

Example as below

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;
    }
}

参考链接
https://stackoverflow.com/questions/46031491/nginx-on-fedora-26-could-not-build-optimal-types-hash-error-message
检索关键词:

FastCGI sent in stderr: “Unabl