Unverified Patch 

The original version assumes MediaWiki is installed under the web server root without any prefixes, e.g. http://hostname/. The unverified proposed modification adds the wgScriptPath to the path.