Php MediaWiki样式表未加载-仅在主页上正常工作//DependencyError:未知模块:MediaWiki.page.startup
我担心我只遗漏了一件小事,但我找不到它 我用nginx在VPS(Ubuntu16.04.)上建立了一个MediaWiki页面,在大多数情况下,它似乎可以正常工作。 一个大问题是,只有主页加载样式表,而其他页面不加载样式表 我在Chrome控制台中遇到以下错误:Php MediaWiki样式表未加载-仅在主页上正常工作//DependencyError:未知模块:MediaWiki.page.startup,php,ubuntu,nginx,mediawiki,fastcgi,Php,Ubuntu,Nginx,Mediawiki,Fastcgi,我担心我只遗漏了一件小事,但我找不到它 我用nginx在VPS(Ubuntu16.04.)上建立了一个MediaWiki页面,在大多数情况下,它似乎可以正常工作。 一个大问题是,只有主页加载样式表,而其他页面不加载样式表 我在Chrome控制台中遇到以下错误: Refused to apply style from '***/load.php?lang=en&modules=ext.visualEditor.desktopArticleTarget.noscript%7Cmediawik
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
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
当我从该错误转到页面时,我得到一个错误代码500和两个PHP警告:
DependencyError: Unknown module: mediawiki.page.startup
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?我不确定如何/在何处调试该问题。我建议您在MediaWiki根目录和
extensions/VisualEditor
中运行git子模块更新--init
和composer update
。另外,确保MediaWiki核心和Visual Editor具有相同的git分支/版本。如果这没有帮助,请将Visual Editor全部关闭,看看是否有帮助。@AlexanderMashin我暂时关闭了Visual Editor以调试/测试内容。但是没有真正的进展。。它仍然没有在编辑页中加载样式表,出现了完全相同的错误(MIME类型的事情)在编辑页上使用Ctrl+F5清除浏览器缓存。@AlexanderMashin我这样做了,仍然存在相同的问题。