Try this:
Change the final line in palmthread.php from:
PHP Code:
onTheFlyPalmDoc($output, "$output", $pdbname);
To:
If that gives you some garbled rubbish when you click on the "Download" link, then we know it's palmlib that's giving you trouble.
Also, are you running PHP in safe mode?
(I am, and occasionally palmlib makes my server burp about safe mode, but it still runs)