I finally decided to use PmWiki as my Wiki engine, just like choosing MovableType for my blog. Before choosing PmWiki, I also successfully installed UseModWiki and OpenWikie on my server, and did some research on MediaWiki. OpenWiki are not so reliable since I frequently meet 500 Server Internal Error。 UseMod is definitely a good choice since the revision function works greatly immediately after installation, but the documentation part is not as good as PmWiki. I specially like the WikiTrails feature, which is not available from other engines.
Internet Information Server
I hosted my site with my ISP. They have configured PHP for me already.
Install PHP on Windows
Although I didn’t do it for this installation, I have successfully installed PHP engine onto my Windows XP.
- Download PHP binary for Windows IIS at PHP‘s website: http://cn2.php.net/get/php-4.3.4-installer.exe/from/a/mirror
- After download, directly double click to run the Windows Installer program.
- Click Next>, Next> and Next>…. accept all the default setting, except the SMTP screen.
- Click OK to confirm the success of the PHP installation.
Well. PHP is successfully installed. It is easier and smoother than I expected.
Download PmWiki Code
- Go to http://www.pmichaud.com/pub/pmwiki/ to download the latest version of PmWiki. I downloaded the pmwiki-0.5.26.zip (153k).
- Extract the files into a folder.
- Upload the whole folder to the web server. There is even no need to edit the configuration files before it works. I am using http://home.wangjianshuo.com/scripts/pmwiki/ as the destination folder.
- After upload, just visit the URL of the file pmwiki.php. It is http://home.wangjianshuo.com/scripts/pmwiki/pmwiki.php for my case. It simplely works well. This surprised me a lot
Although it does not take any extra effort to let PmWiki up and running, some important steps are neccessary for PmWiki to work on Windows flatform.
Diff and Patch
By default, everything in PmWiki works on Windows except the page revisions (sample). This problem is not obvious, so you may need the following reproduce steps:
- Open any page in your installation.
- Make any changes by clicking the Edit Page and save it.
- Click Page Revisions at the end of the page. It should show the difference betwee the two versions. However, most user will see blank lines and some Restore links. The Restore link does not work since all the versions are shown as the final version – the history of the editing is not perserved as the sample revision page shows.
DiffAndPatchForWindows offers some directions to solve the problem. PmWiki relies on external command of diff and patch for version control. Neither of the command are natively available on Windows. The easiest way, as stated in the article, is to download GNUWin32 diff and patch tools.
- Download the two Windows setup files. The SourceForge site of GNUWin32 offers too many choices and it is not strait forward for our installation propose. This is the shortcut:
- Double-click each of them to run the setup program.
- Accept all the default settings during the setup.
- You should find the following files under C:\program files\GnuWin32\bin folder, if you used the default setting:
- Upload these files to a folder on your server. I used /scripts/bin. Actually, sdiff.exe, diff3.exe and cmp.exe are optional. The other three .dll are required for diff.exe and patch.exe to run.
- Create a local.php at the same folder as PmWiki.php if it is not there yet.
$SysDiffCmd = ‘E:\\Customer\\Wangjianshuo\\scripts\\bin\\diff.exe ‘;
$SysPatchCmd = ‘E:\\customer\\wangjianshuo\\scripts\\bin\\patch.exe –silent’;
Replace the my path with your own path.
Now your blog should support the revision feature. Please note that all pages modified before diff and patch will permennantly lose the function of roll-back since the diff history was not preserved.
Chinese is not completely supported in PmWiki, so does other Asia languages. It is because PmWiki, like other Wiki engines, use \xB0 as new line seperator, which falls into the Chinese GB2312 encoding area. So characters with \xB0 as the first byte will be considered as newline and cause problem. Here is the solution (in Chinese).
After the applying the patch, I also downloaded the interface localizatino pack.
Do you know why they are using i18n? It is Internationalization. There is exactly 18 characters between i and n and few people want to spell it out. LOL.