This post is part of a series of posts about MediaWiki on Windows :
- Installing MediaWiki on Windows Server 2012 R2 Core
- Installing VisualEditor for MediaWiki on IIS
- Enabling Media / File Uploads For MediaWiki on Windows Server
Enable PHP File Uploads
Check that “file_uploads = On” is present in your PHP.ini file. It was already enabled in my installation. If you have followed the other guides in this series, the file should be here :
C:\Program Files (x86)\PHP\v5.4\php.ini
Set the temp file upload path in PHP.ini.
On Windows, if PHP was installed by WebPI this will be set to %SystemRoot%\Temp. It needs to be set the same as the “$wgTmpDirectory” var in the MediaWiki LocalSettings.php file. If you have followed the steps in my previous posts – you will have already added the correct permissions to this folder.
Permissions on the Upload Folder
I was following the guide here which suggests you need to change the permissions on the folder :
C:\inetpub\wwwroot\wiki\images however, it looks like permissions have been set correctly on the folder above and inherited down.
If your PHP.ini file needed a change, you will need to restart IIS on the server (to cause PHP to restart and read its config again). If not, you should be able to see a new option on the left hand menu on every wiki page called ‘Upload file’ – great step 1 complete! Now does it work? Clicking the link should take you to a page where you can choose a file to upload. Try uploading a file and ensure it renders correctly – if its an image.