For quite some time I've restricted my files permissions to 644 and my folders permission to 755 running under suExec and implementing php5.cgi.
Unfortunately your script doesn't work properly unless I make a number of files at least 646 if not 666.
Is there anything you could do to your script so that the files it generated both under:
as well as under:
Would be owned by the "userhere users" (default user on the server), than the "nobody www" one it currently uses?
That way I could keep all the files, including the ones used/generated by your script set to 644.