Well, as far as I can tell, mod_php is for Apache 2.x only. Only Apache 1.3 is available for iPhone. Also, after *many* hours of placing echo's in various places throughout the code, I discovered that the cleanText function is always returning a null value. This led me to figure out the preg_replace is erroneously returning null values, which I *think* is a bug in the specific version of PHP that was compiled for iPhone and only affects BSD systems.
Note, that the dokuwiki system can otherwise write files to the filesystem just fine. My cache and session folders get written to. Also, when I commented out the preg_replace line in cleanText, it started writing the correct files to
data/pages[/m]. Unfortunately, a [m]cat * | grep preg_replace[/m] returns pages of code in the [m]inc folder alone, so, obviously, dokuwiki still does not work for me.
To answer your other question, neither Lighttpd nor PHP are generating errors; however, I do know that the logs are working properly since they *were* generating errors until I got them configured properly.
I've been working on compiling the iPhone development toolchain so that I can compile a new version of PHP. Unfortunately, my only Mac is an Intel Mac that is running Leopard (OSX 10.5). The toolchain can't be compiled on Intel+Leopard (it can on any other combination of hardware+OSX version >= 10.4). Fortunately, the toolchain can also be compiled on Linux. I've been having problems with Ubuntu, so I just installed CentOS. Hopefully I can build the latest version of PHP on that.
UPDATE: I have fixed preg_replace. Note PHP bug ID# 41580
http://bugs.php.net/bug.php?id=41580 I added a line to
php.ini[/m] (which on the iPhone goes in [m]/opt/iphone/lib/[/m] for anyone trying to duplicate this): [m]pcre.backtrack_limit = 10000000
Still, I have the same problem. Another thing worth mentioning is that the "do=diff" action works as expected. Only "do=show" does not work.
UPDATE 2: I have traced the problem to the function io_readFile where
join('',file($file)) returns a null value. Also worth mentioning is that if I include ~~NOCACHE~~ in my page, then it does recognize that a page is there, and I can do=diff on it; however, do=show gives me a "Create this page" button.