Loading...

2.2 MediaWiki and Macintosh OS 10.5 Leopard

By Mark Choate
Last modified: 2008-10-31 13:10:20

When I upgraded from 10.4 Tiger to 10.5 Leopard, my MediaWiki installation stopped working. There were three things that needed to be done:

  1. Enable PHP on Apache2

  2. Update user configuration for Apache2

  3. Create php.ini and update default MySQL socket path.

Enable PHP

The httpd.conf configuration file for Apache2 on 10.5 can be found at the following location:

/etc/apache2/httpd.conf

Open the file and make sure the PHP5 module is being loaded. If it's not being loaded, you should be able to find the following line:

#LoadModule php5_module        libexec/apache2/libphp5.so

The previous line should have the leading "#" character removed, so that when you are finished, the line should read:

LoadModule php5_module        libexec/apache2/libphp5.so

You'll need to restart Apache2 for this to work. You can do it in System Preferences, but the easiest way is on the command line:

/usr/sbin/apachectl restart

Update User Configuration

This step only needs to be done if you are serving files out of your user's Site directory. When Apache2 is upgraded, it fails to copy over some configuration files and you'll be told you aren't allowed to access the directory with a "403 Forbidden" error.

To fix this, you need to copy the user configuration files from the old Apache 1.3 installation to the appropriate directory:

sudo cp /private/etc/httpd/users/* /private/etc/apache2/users/

Create php.ini file

Once I accomplished the previous steps, I would get the following error when I tried to view a MediaWiki page:

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock

That's because the mysql.sock file is now in a different place:

/tmp/mysql.sock

To fix this, you need to find the php.ini file. If you've just upgraded, it probably doesn't exist, but you should be able to find php.ini.default in /etc/. Edit that file and find the following line:

mysql.default_socket =

Once you've found the line in question, change it to this:

mysql.default_socket = /tmp/mysql.sock

Restart Apache2 again, and everything should work fine.

View Mark Choate's profile on LinkedIn

Local Navigation