Apache and PHP are pre-installed on Mac OS X client, but disabled by default. The following should work for Leopard (10.5.x), Tiger (10.4.x) and Panther (10.3.x) client (if there is no previous version of DokuWiki installed). For Lion/Mountain Lion (10.7.x/10.8.x), the Sites folder no longer exists. These instructions revive it. Then follow the instructions below skipping step 4.
$ sudo cp /private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf.bak
$ sudo pico /private/etc/apache2/httpd.conf
#LoadModule php5_module
LoadModule php5_module
$ cd ~/Downloads && tar -zxvf dokuwiki-yyyy-mm-dd.tgz $ mv dokuwiki-yyyy-mm-dd ~/Sites/dokuwiki $ cd ~/Sites/dokuwiki $ sudo chown -R www data conf lib/plugins lib/tpl
You should now be able to run the installer at http://localhost/~your_username/dokuwiki/install.php
EDIT: since OSX Mountain Lion, the simple “Web Sharing” Option is no longer the way to start the Apache. Please follow the following link to get Apache run under OSX Mountain Lion:
EDIT2 (Oct2022): MacOS since Monterey does not include a web server anymore. Consider installing Dokuwiki with built in PHP and web server: php_build-in_webserver
For Tiger (10.4.x) and Panther (10.3.x) server:
$ cd ~/Desktop && tar -zxvf dokuwiki-yyyy-mm-dd.tgz $ mv dokuwiki-yyyy-mm-dd ~/Sites/dokuwiki $ cd ~/Sites/dokuwiki $ sudo chown -R www data conf
You should now be able to run the installer at http://localhost/dokuwiki/install.php
If you use Nginx as server, You should config nginx.conf like:
index index.php;
location ~ '^/(data|conf|bin|inc)/' {
deny all;
}
location ~ /.+\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
Further instructions for Nginx: https://www.nginx.com/resources/wiki/start/topics/recipes/dokuwiki/