in reply to Errors from forked process

Like jeshuaok I suspect that Apache post-cgi cleanup is closing your stdout/stderr file handles.

While not the best final solution, the first thing I would try would be to open a logging file and alias it to STDERR. Something like this:

open NEW_STDERR, ">/tmp/mylog.$$" or die "with some reasonable message +"; *STDERR = *NEW_STDERR;