Jump to content

Topic on Project:Support desk

Getting scripts and styles fails (err 500) with $wgLanguageCode="de"

11
Tetramil (talkcontribs)

Hello !

I installed MediaWiki 1.3.1 on a Windows/IIS server with PHP 7.3.0 and MySql 8.0.

After installation (with language set to German i.e. "de"), the mail pages shows up but with no CSS styling. In the network tab of the browers development tool I see that getting scripts and styles fails with error 500.

Now when I change $wgLanguageCode="en" this problem is gone. The initial pages are in english now. Users with their profile set to "de" see the German page just fine.

I know I should probably provide some Infos from the log files, but I'm completely new to MediaWiki and therefore don't know where to look. Can you please advise?


Thanks!

Ciencia Al Poder (talkcontribs)

Temporarily set $wgShowExceptionDetails = true; in LocalSettings.php and open the load.php URL that returns a 500 error. You should be able to see details about the error that could give a hint of the problem

This post was hidden by AhmadF.Cheema (history)
Tetramil (talkcontribs)

Ok, here's the output. Any idea?


<!DOCTYPE html>

<html><head><title>Internal error – mypedia</title><style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style></head><body>

<div class="errorbox mw-content-ltr"><p>[8b9da3388ae7579791af6f08] /load.php?debug=false&amp;lang=de&amp;modules=startup&amp;only=scripts&amp;skin=vector   Error from line 689 of C:\inetpub\wwwroot\mypedia\includes\exception\MWExceptionHandler.php: Class 'FormatJson' not found</p><p>Backtrace:</p><p>#0 C:\inetpub\wwwroot\mypedia\includes\exception\MWExceptionHandler.php(216): MWExceptionHandler::logError(ErrorException, string, string)<br />

#1 C:\inetpub\wwwroot\mypedia\includes\AutoLoader.php(109): MWExceptionHandler::handleError(integer, string, string, integer, array)<br />

#2 C:\inetpub\wwwroot\mypedia\includes\AutoLoader.php(109): require()<br />

#3 [internal function]: AutoLoader::autoload(string)<br />

#4 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoader.php(141): spl_autoload_call(string)<br />

#5 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoaderStartUpModule.php(440): ResourceLoader-&gt;preloadModuleInfo(array, DerivativeResourceLoaderContext)<br />

#6 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoaderStartUpModule.php(422): ResourceLoaderStartUpModule-&gt;getAllModuleHashes(DerivativeResourceLoaderContext)<br />

#7 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoaderModule.php(831): ResourceLoaderStartUpModule-&gt;getDefinitionSummary(DerivativeResourceLoaderContext)<br />

#8 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoader.php(665): ResourceLoaderModule-&gt;getVersionHash(DerivativeResourceLoaderContext)<br />

#9 [internal function]: ResourceLoader-&gt;{closure}(string)<br />

#10 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoader.php(678): array_map(Closure, array)<br />

#11 C:\inetpub\wwwroot\mypedia\includes\resourceloader\ResourceLoader.php(759): ResourceLoader-&gt;getCombinedVersion(ResourceLoaderContext, array)<br />

#12 C:\inetpub\wwwroot\mypedia\load.php(51): ResourceLoader-&gt;respond(ResourceLoaderContext)<br />

#13 {main}</p></div>

</body></html>


Ciencia Al Poder (talkcontribs)
Tetramil (talkcontribs)

Hm, ok, are you sure?

On the page you linked they say "As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default." and I have PHP 7.3, so shouldn't that extension not already be in there?


And the output of php -i contains these lines:


json support => enabled

json version => 1.7.0


I'd like to try the php-json module of course, but where can I find it compiled as a Windows x64 .dll?

Tetramil (talkcontribs)

It seems I resolved this issue by adding this line to LocalSettings.php:

require_once("$IP/includes/json/FormatJson.php");

The error 500 is gone. So this works, but why???

Ciencia Al Poder (talkcontribs)

Is this a new installation? or an upgrade?

Tetramil (talkcontribs)

A new installation

Ciencia Al Poder (talkcontribs)

I don't know, then. Looks like you're the first person with that problem that I know of. Maybe this is a problem with PHP 7.3?

星耀晨曦 (talkcontribs)

What is certain is that the class autoloader does not work as expected.

Reply to "Getting scripts and styles fails (err 500) with $wgLanguageCode="de""