From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Load.php and the translation is 11% complete.

Other languages:
Deutsch • ‎English • ‎dansk • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎русский • ‎العربية • ‎ไทย • ‎中文 • ‎日本語

load.php is a script for the front-end to hook into for loading ResourceLoader modules.

Styles not displaying

After they updated to MediaWiki 1.18 or newer, many users had the problem that their wiki showed up without styles. CSS styles were not applied; what they saw instead looks like a trimmed down version. All styles are browser defaults; no special styles are applied.


The problem in most cases is caused by the fact that requests to load.php are redirected to the MediaWiki main PHP file, which finally returns a MediaWiki page. The expected output however are CSS styles.

To fix the issue you have to add a RewriteCond and a RewriteRule in the file .htaccess. Change your .htaccess file to make sure that calls to load.php (and to api.php also.) are not rewritten.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule (api|load)\.php - [L]

After that load.php should return the right contents and your wiki should be styled.

Other possible problems: Manual:Errors and symptoms#The wiki appears without styles applied and images are missing

If your server is running on windows, there is no .htaccess file yet. What you have to do, is create a new document in your editor, paste the above lines and save it as ".htaccess". Load this file up in your wiki installation folder.

"Sessions are supposed to be disabled for this entry point"

Code executed via load.php should not rely on the user's session as its results will be cached and sent to other users. Starting from MW 1.28, this is enforced and a "Sessions are supposed to be disabled for this entry point" exception will be thrown if a session access is attempted. See these tips on how to fix.


First it checks the PHP version, which must be 7.0.13 or higher, and it includes WebStart.php . Next, it creates a ResourceLoader object and calls its respond() method, which outputs the specified resource content, including a content-type header.

A custom value for the location of the load.php script can be provided using $wgLoadScript .