23 February 2016

Mediawiki 1.26.2 - Stylesheet not working/loading


We were running Mediawiki installation for one of our clients for quite some time. The Mediawiki version that we were using was 1.23.5. Since this version was quite old and has come to legacy status, we decided to upgrade to latest version of Mediawiki (1.26.2).

We downloaded and installed Mediawiki latest version 1.26.2. When we ran this version, we observed that the stylesheets are not working/loading. In older version (1.23.5) of Mediawiki installed on same server, it was working fine. We checked LocalSettings.php file multiple times and everything seems to be fine.

The Mediawiki 1.26.2 site was deployed as a directory in a website under IIS (Windows 2012 server). In same website, Mediawiki 1.23.5 was deployed under different directory. Mediawiki 1.23.5 stylesheets were loading fine. However for 1.26.2 it was not working.

We also tried deploying Mediawiki 1.26.2 under a new website  just to be sure that directory inside a website is not creating any problem. But still it didn't worked. We tried both with http and https protocol but it did not made any difference.

Finally after lots of research on mediawiki forums, we found the solution for this issue.

The problem was that PHP.exe did not had write access to temp folder where it creates temp files during application execution. This was fine with older versions of MediaWiki (E.g. - MediaWiki-1.23.5). However latest version (E.g. - Mediawiki-1.26.2) do not loads styles due to this problem.

By default PHP uses C:\Windows\Temp directory for storing temp files. However it was not possible to give permission to this directory due to security restrictions on our server.

So we modified php.ini file and defined a custom temp directory where PHP can store its temporary files. We gave read/write permissions to this folder. After doing this modification, we did iis-reset and when we opened Mediawiki 1.26.2 version, that stylesheets started appearing fine.

Hope this will help.

No comments: