Turned out to be a protection issue. Apache didn't have the rights to write the file. It was the error message that misled me. Hopefully I can publish the php source soon. Thanks Dave Bamford