MediaWiki Configuration

MediaWiki Configuration

From Consultancy.EdVoncken.NET

Jump to: navigation, search

[edit] Enabling PNG uploads in MediaWiki

By default, MediaWiki does not allow PNG uploads. Two changes need to be made:

  1. Allow the PNG extension (MediaWiki)
  2. Set MIME type for PNG (Apache)

[edit] Allow the PNG extension

Verify that $WIKI/includes/DefaultSettings.php has an entry for PNG in the list of extensions:

 $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );

If not, set the $wgFileExtensions variable in your LocalSettings.php file.

[edit] Set up MIME types

In Apache configuration file /etc/httpd/conf/magic, make the following change (universal diff format, add lines with '+' in front):

[root@dell conf]# rcsdiff -u -r1.1 magic

 ===================================================================
 RCS file: RCS/magic,v
 retrieving revision 1.1
 diff -u -r1.1 magic
 --- magic       2008/01/08 14:47:30     1.1
 +++ magic       2008/01/08 14:48:28
 @@ -248,6 +248,9 @@
  # GIF
  0      string          GIF             image/gif
 
 +# PNG
 +1      string          PNG             image/png
 +
  # JPEG images
  0      beshort         0xffd8          image/jpeg