regular PHP vs. Apache PHP module



I developed a PHP program that creates both files and subdirectories as part of its operation. It was developed on a server running regular PHP, version 4.2.3.

Then I ported it to a server running the Apached PHP module version 4.2.2. Nothing worked. The problem apparently has to do with directory permissions. On the server running regular PHP, directory permissions could be set to 0755 (just the Owner permission set to "write"), but on the mod PHP setup, the permissions on directories have to be set to 0777 (Owner, Group and Public set to "write").

I'm not sure what my question is here... I guess I'm just trying to verify that my understanding is correct. Is it? :?:
Are you getting any errors or is it just not working.. usually the errors point you to where to look.

Usually Apache runs as user Nobody so you would have to use 777 like you mentioned. If nobody is in the same usergroup as your username you can use 775
Apparently when an Apache server is using the mod PHP, it takes ownership of any files or subdirectories that are created when they are created, so if the directory in which a file resides is not set to 0777, it is not possible to write to to the file. I have no idea why it has to be that way. It is not that way when a server is running regular PHP.

The advantage to the mod PHP is speed. It is supposed to be faster.

I'm working out the problems in the application... i.e. when it creates subdirectories, it CHMODs them immediately to 0777. Then and files created in the subdiretory work fine for reading, writing and removing... the 3 Rs... :)