CGIKitを実行すると次のようなエラーが表示されていた。ようやく理由がわかって正常に動作するようになった。

Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: HelloPage.html

If you think this is a server error, please contact the webmaster.
Error 500
localhost
Tue Jun 7 00:27:13 2005
Apache/2.0.50 (Unix)

エラーの原因は、パーミッションだった。
CGIKitは実行時にスクリプトのあるフォルダにtmpフォルダを作る。tmpフォルダの書き込み権限はスクリプトを実行したユーザーのものになる。
以前コマンドラインから実行したときにできたtmpに、CGIユーザから書き込もうとしてエラーになっていたようだ。