Question: Hi techglimpse, I have recently installed MediaWiki version 1.25.2 successfully. But I’m not able to upload an image file (say JPEG) via ‘Upload file‘ link present at the sidebar. The MediaWiki fails with an error message as “fatal exception of type mwexception mediawiki” – Shankar
Answer:
Shankar, by default MediaWiki will be configured to support image uploads in LocalSettings.php file – Check for the variable ‘$wgEnableUploads = true;‘. Since you used the link ‘Upload file‘ from sidebar, it means the variable $wgEnableUploads is already set to true. So the next step is to check if there’s an ‘images‘ folder in the wiki installation directory.
For e.g; If your wiki is installed under ‘/var/www/html/wiki‘, then you should have an ‘images’ folder under it. Importantly, the ‘images’ folder should be owned by the user that runs Web Server (say, if ‘apache’ is the user that runs HTTP server, then ‘images’ folder should be owned by ‘apache’ user with write permission)
# pwd /var/www/html/wiki # ls -ld images/ drwxr-xr-x 6 apache apache 4096 Aug 26 12:09 images/
Also enable ‘$wgShowExceptionDetails‘ in LocalSettings.php file to view the exception stack trace printed to the output. – check whether the information printed by stack trace has any clue about the error.
Hope this helps.
Do you want us to solve your Linux errors? Just drop a mail (check Contact Us page).