Apache is run as unpriviledged user "www" for ibays. This is a feature. If you need to write somewhere from cgis in an ibay, it should be to somewhere in the ibay. Otherwise you are compromising the security of your server.
Remember, cgi's are run by anyone who comes along. Security is not optional.
mps