Mediawiki nginx 500 内部服务器错误

Mediawiki nginx 500 internal server error

我正在尝试设置 mediawiki,但一直收到 500 内部服务器错误。

/var/log/nginx/error.log 为空。 PHP 那里记录了错误,但我没有看到任何与 mediawiki 相关的错误。

我试过在 php.ini 中将 display_errorsdisplay_startup_errors 设置为打开,但这没有帮助。

我认为这可能是文件权限问题,但整个 /wiki 设置为 755 并归 www-data:www-data 所有。

我也遵循了这个:https://www.mediawiki.org/wiki/Manual:How_to_debug 并在 /wiki/index.php/wiki/LocalSettings.php 中包含了相关行,但错误日志仍然是空的。

这是我的 nginx 配置:

server_tokens off;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";

server {
        listen 443;

        ssl on;
        ssl_certificate /etc/letsencrypt/certs/cert.pem;
        ssl_certificate_key /etc/letsencrypt/certs/privkey.pem;

        root /var/www/html;

        index index.php;

        server_name example.com;

        error_page 404 /404.html;
        error_page 500 /500.html;

        location = /wiki {
         return 301 /wiki/;
        }

        location ~ \.php$ {
         include snippets/fastcgi-php.conf;
         fastcgi_pass unix:/run/php/php7.1-fpm.sock;
         fastcgi_intercept_errors on;
         include fastcgi_params;
        }

        location ~ /\.ht {
        deny all;
        }
}

我该如何解决这个问题?如果错误日志中没有任何内容,我无法弄清楚到底出了什么问题。

我设法通过删除 fastcgi_intercept_errors on; 解决了这个问题,这导致 mediawiki 指出我缺少 xml PHP 扩展名。