Php – MediaWiki not displaying style — “Internal error”

cssmediawikiPHPupdateupgrade

I just upgraded a MediaWiki installation from version 1.25.x to 1.26.1, but now the styling information is not displaying. Hence, the page displays all text-like without the links column at the left. When I view the source of the page and click on the link that is supposed to load the style, there appears to be some CSS but the file starts as follows:

/*
Internal error

Internal error

Problematic modules: {"mediawiki.sectionAnchor":"error","skins.vector.styles":"error"}
*/

When I click instead on the script link in the page source, presumably for the default script, it shows a similar message (but without much actual code):

/*
Internal error

Internal error

Problematic modules: {"startup":"error"}
*/

From searching Online I found the following two pages, which as of this writing do not have any solutions:

https://www.mediawiki.org/wiki/Topic:Sty0r6j0y9u8yute

https://www.mediawiki.org/wiki/Topic:Stvdbhcbttk5aa9d

If it matters, the installation I am working with is on HTTPS. The $wgServer setting is set accordingly to $wgServer = "//www.some-domain.com";. Images load just fine, and there are no 404's or other such HTTP errors on the network tab of the browser debugger. The server is running PHP version 5.6.16.

My questions are:

(1) Has anyone else had this problem and found a solution other than downgrading PHP?

(2) Does anyone know if upgrading PHP to the new 7.x series would resolve this issue? (there are some big WordPress installations on the same server, so I have not dared trying to install the new PHP just yet)

Update 1: While I have no idea what the underlying issue is, apparently the problem is specific to the default Vector skin. I changed the $wgDefaultSkin setting (in LocalSettings.php) from vector to monobook, and now the wiki displays just fine.

Update 2: As was requested in the comments, I tried downloading the Vector skin directly from GitHub. I downloaded the latest master branch (as of 2015-12-18). Unfortunately, it made no difference. After deleting the old files and copying in the new (or same?) files and changing the setting back to vector, the problem came back.

Update 3: For the sake of completeness, I tried installing the wmf/1.27.0-wmf.9 branch of Vector, but it made no difference. I even tried restarting the Web server to make sure it was not a caching issue.

Update 4: I tried clearing the server-wide PHP cache, but it made no difference. I then tried enabling the $wgResourceLoaderDebug option. While this option did not resolve the issue with loading, I suppose it would provide better details to someone actually debugging the skin. With this option enabled, the page source shows 5 separate stylesheet entries, only two of which get the Internal error. There is still only one script entry, and it still gets the error.

Best Answer

After enabling full MediaWiki debugging as suggested by Froggiz, I have come to discover a few specific problems in this case, one of which was the actual cause of Vector's failing to load. The problems and solutions are as follows:

(1) The $wgCacheDirectory was commented out in LocalSettings.php. While the MonoBook skin did not seem to care about this condition, Less.php gets an exception without the cache folder being writable; and apparently this module is necessary for the Vector skin. I ended up setting the cache setting as follows:

$wgCacheDirectory = "$IP/cache"; // Make sure this folder is writable;

(2) Although not the cause of the main problem, there were four files expected that apparently were not included in the standard MediaWiki version 1.26.1 package. In fact, it was a copy of one file that was missing: en-gb.json. This file had to be created and placed into the following locations:

/resources/lib/oojs-ui/i18n

/skins/CologneBlue/i18n

/skins/Modern/i18n

/skins/Vector/i18n

Although the comment in LocalSettings.php for $wgLanguageCode says to choose a language code from ./languages/Names.php, the language code must have corresponding files in the i18n folders of the skins.

Related Topic