MediaWiki on Mac OS X 10.3/Jaguar

Yesterday I installed MediaWiki on Mac OS X 10.3/Jaguar. Apache is installed by default on OS X. So is PHP, but I couldn’t get it to run. So I wound up installing binaries of PHP and MySQL.

I learned a lot, but maybe the most important thing was that on OS X, starting PHP tags must have the form:


Otherwise the code does not run. I saw quite a few confused netizens asking why their scripts suddenly didn’t run when tried on OS X.

It took a couple of tries to get the MediaWiki first-time-configuration script to run. It kept asking me for a root password, in order to set up a new MySQL account. It took me a few tries to realize this was my MySQL password, not the BSD root user’s password.

I didn’t expect to need to configure the DNS. I just had an IP address, no hostname. When I put in the direct ip of my machine, fine. As soon as I switched to a subdirectory, 404. It was the UseCanonicalName directive in the httpd.conf file. Once I set that to off, everything was fine.

I learned that on OS X the default directory where Apache serves files is:


On OS X, su doesn’t get the superuser account. THe command to use is sudo.

sudo bash

opens up a new shell as root.

To start and stop Apache, I used the Sharing control panel (Apple Menu > System Preferences > Sharing) Apache is called Personal Web Sharing and there’s a big, shiny button that turns it on and off.
httpd.conf iss located by default in:


Apache’s environment variables are displayed by the command:

httpd -V

Leave a Reply

You must be logged in to post a comment.