From the manual:
DokuWiki is executed by PHP, so the PHP process needs to be able to write to these files. The PHP process usually runs with the permissions of the webserver, so the webserver needs to be able to write to these files.
If you have installed Dokuwiki from the web-based script which Dokuwiki provides (
https://www.dokuwiki.org/install:downloader) or using your system's package manager, then you probably have the correct permissions already. The web server runs under the following users:groups:
Debian/Ubuntu: www-data:www-data
Centos/RedHat: apache:apache
OpenSuse: wwwrun:www
Mac OSX: _www:_www
Otherwise check the configuration file for your web server.
Also see the following:
https://www.dokuwiki.org/install