如何解决MediaWiki 样式表未加载 - 仅在 MainPage 上正常运行 // DependencyError: Unknown module: mediawiki.page.startup
我担心我只是错过了一件小事,但我找不到。
我已经在 VPS (Ubuntu 16.04.) 上使用 nginx 设置了一个 MediaWiki 页面,并且在大多数情况下它似乎可以正常工作。 一个大问题是只有主页在加载样式表,而其他页面没有。
我在 Chrome 控制台中收到此错误:
Refused to apply style from '***/load.php?lang=en&modules=ext.visualEditor.desktopArticleTarget.noscript%7Cmediawiki.action.edit.styles%7Cmediawiki.editfont.styles%7Cmediawiki.widgets.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui.styles.indicators%7Cskins.vector.styles.legacy&only=styles&skin=vector' because its MIME type ('text/html') is not a supported stylesheet MIME type,and strict MIME checking is enabled.
还有这些警告:
DependencyError: Unknown module: mediawiki.page.startup
Skipped unresolvable module ext.visualEditor.desktopArticleTarget.init
当我从该错误转到页面时,我收到错误代码 500 和 2 个 PHP 警告:
Warning: Undefined property: DOMDocument::$documentElement in /var/www/mediawiki/includes/resourceloader/ResourceLoaderImage.php on line 348
Warning: Attempt to read property "firstChild" on null in /var/www/mediawiki/includes/resourceloader/ResourceLoaderImage.php on line 352
不确定我应该提供什么,这是我的 nginx 配置:
# HTTPS Configuration
server {
listen 80;
server_name ***.com www.***.com;
root /var/www/mediawiki;
index index.php;
autoindex off;
client_max_body_size 5m;
client_body_timeout 60;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?title=$1&$args;
}
location ^~ /maintenance/ {
return 403;
}
# PHP Configuration
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
try_files $uri /index.php;
expires max;
log_not_found off;
}
location = /_.gif {
expires max;
empty_gif;
}
location ^~ ^/(cache|includes|maintenance|languages|serialized|tests|images/deleted)/ {
deny all;
}
location ^~ ^/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
internal;
}
# Security for 'image' directory
location ~* ^/images/.*.(html|htm|shtml|php)$ {
types { }
default_type text/plain;
}
# Security for 'image' directory
location ^~ /images/ {
try_files $uri /index.php;
}
}
皮肤坏了吗?还是整个页面/nginx conf?我不确定如何/在哪里调试该问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。