Table of Contents

Dokuwiki - Dev environment Configuration and Installation

About

This is the installation and configuration of the dokuwiki development platform on Windows that we use.

No container anymore

We are not working with WSL or any docker anymore because it causes too much pain for little improvement. ie:

This is a sort of keep it simple by staying with the smallest tech stack as possible.

Steps

Install php

The PHP version is the lowest supported by Dokuwiki which is 7.4.20 (See splitbrain/dokuwiki/blob/stable/.travis.yml) This is also the lowest version supported by webhosting provider such as OVH.

For the version 7.4.20:

php.exe -i > phpinfo.txt

PATH Environment variable

Add in the PATH the php directory

Optional

Extension

extension

; some compilation needs the whole path for the extension dir
; extension_dir = "c:/php-7.2.28-Win32-VC15-x64/ext"
; some compilation (ie apache.dll) does not need the extension dir (ie 7)
extension_dir = "ext"
[PHP]
; for image
extension=gd2
; for composer
extension=curl
extension=fileinfo
extension=mbstring
extension=pdo_sqlite
; openssl (ie fopen(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?)
extension=openssl 
; for locale
extension=intl

You can check if they are loaded with:

php -m

and with apache via a phpinfo web page:

Phpinfo Mbstring Enabled

XDebug

This section is a summary of the article Xdebug for php 7.4

To enable Xdebug on a dokuwiki devel computer:

[Xdebug]
zend_extension = xdebug
# zend_extension=C:\php-7.4.20-Win32-VC15-x64\ext\php_xdebug-3.1.16-7.4-vc15-x86_64.dll
; enable the debugger
xdebug.mode=debug

; Xdebug 3 - default debugging port has changed from 9000 to 9003.
xdebug.client_port=9003

Phpunit

cd yourProject
wget -O phpunit.phar https://phar.phpunit.de/phpunit-7.phar

Package Manager

optional

Install

Install Apache

Apache installation, virtual host and php configuration

Create the virtual host to the dokuwiki root.

Example:

<VirtualHost *:80>
    DocumentRoot "d:/dokuwiki"
    ServerName doku
	DirectoryIndex index.php
    ErrorLog "logs/doku.com-error.log"
    CustomLog "logs/doku.com-access.log" common
	<Directory "d:/dokuwiki/" >
		Require all granted
		AllowOverride All
		Options Indexes FollowSymLinks Includes ExecCGI
	</Directory>
</VirtualHost>

Dokuwiki

Clone Dokuwiki

You need to clone it in order to get the dokuwiki test class.

git clone git://github.com/splitbrain/dokuwiki.git .

Configuration

Go to: http://VitrualHost/install.php to configure it

Go to the configuration manager:

Install Stale

Install Stale to stale the cache easily.

Because we are the authors, we clone it.

cd $DOKUWIKI\lib\plugins
git clone https://github.com/ComboStrap/stale

IDEA

See also the dokuwiki documentation

Go to Settings > Version Control > Directory Mapping to add the plugins git repository

Interpreter

Set the php interpreter to 7.1

Php Interpreter Idea

Unit test

Phpunit Settings: To run individual test file on plugin:

Dokuwiki Phpunit Idea

Then:

Phpunit Template Idea

Library

Add Jquery as library:

Browser

Disable the cache in devtool

Chrome Disable Cache

Support

Call to undefined function dokuwiki\Utf8\mb_strtolower()

extension=mbstring
; extension_dir="ext"