Shapejam

Trying to follow Buckminster Fuller's example in life, one step at a time to bring you brain scrapings for a new millennium.

Setting Up MediaWiki on an Apple Mac

05 Jan 2013 - Nic Ho Chee

After one too many issues with a Hackintosh and a short but painful trip to an Apple store my MediaWiki Windows installation needed moving across into the unknown realms of OSX. After some surprising turns the install worked and the steps have been captured for posterity.

What Do I Need To Try This Out

The post is split into two sections, the first covers a basic MediaWiki installation and the second covers setting up MediaWiki Math support. For a basic installation:

  1. MediaWiki. I'm using 1.20.0 which can be picked up here http://www.mediawiki.org/wiki/Download.
  2. XCode and the Command Line Tools for XCode. DL XCode from the Apple App Store, you'll need to pick up the Command Line Tools for XCode from here; https://developer.apple.com/downloads/index.action#
  3. Libltdl. You can pick this up from here; http://www.gnu.org/software/libtool/
  4. Imagemagick. Use 6.7.2, which you can pick up from here; ftp://ftp.imagemagick.org/pub/ImageMagick. I don't want to use MacPorts, so I couldn't use the built version on ImageMagick.org.
  5. Mamp. The installation works with 2.1.1 which can be picked up from here; http://www.mamp.info/en/index.html
For MediaWiki Math support:
  1. MediaWiki Math Extension. Download the 1.19 version; http://www.mediawiki.org/wiki/Special:ExtensionDistributor/Math
  2. Ocaml. Download the 4.01 version; http://caml.inria.fr/ocaml/release.en.html
  3. LaTex. Download the 2.1G version; http://www.tug.org/mactex
  4. Ghostscript. Download the 9.06 version; http://www.ghostscript.com/download/gsdnld.html

How To… Install The Basic Verson

…And that should be about it. You should now be able to create pages like this:

How To… Install the MediaWiki Math Extension

This is really handy if you're looking to embed math notation like this... ...into your wiki posts.

Unfortunately here is where you may start to have problems. MAMP changes the DYLD_LIBRARY_PATH to use the Macport version for some of the paths and you should be using the Apache libs which are built with OSX. If you look in the console you will probably have a set of dvipng and convert with Symbol not found: _cg_jpeg_resync_to_restart etc errors. If you're interested in tracking down the errors yourself, you can turn on the debugging and logging by adding the following to the top of your LocalSettings.php file and clearing the wiki cache:
error_reporting( -1 );
ini_set( 'display_errors', 1 );
$wgShowDebug = true;
$wgDebugToolbar = true;
$wgDebugLogFile = "$IP/debug.log";

Purge the wiki cache and you should be able to add Math notation to your hearts content and create pages like this:

Enjoy :).