rfox
02-24-2000, 11:23 AM
Hi,
I have a PHP application that writes config files and directories to disk. This system was developed on another host and recently transferred to FQ. I have noticed since the transfer that when I invoke the functionality to do the following:
[nbsp][nbsp][nbsp][nbsp][nbsp]create a directory
[nbsp][nbsp][nbsp][nbsp][nbsp]write a file into that directory (fopen, fputs, etc.)
that the operation invariably fails with the following:
"Warning: SAFE MODE Restriction in effect. The script whose uid is 42469 is not allowed to access conf/chix/sbg/site.conf owned by uid 98"
What's happening is that the directory is created successfully with the uid of the apache process, however, when the fopen, fputs functions execute, they apparently execute with the uid of my username. (Furthermore, the directory that is created by the apache process is only writeable by the owner, so I can't interact with it, which is normally not a problem since all interactivity in these directories are handled by the "app" that I have created... assuming of course that the app *can* interact with the directories, which it apparently can not.).
Naturally I can add lines that chmod the new directory so that it is writeable by group and world, however, I find it wierd that these two similar operations run under different uids.
Will I *need* to add chmod functionality to the directory creation algorithms? --or is something else amiss?
Rich.
I have a PHP application that writes config files and directories to disk. This system was developed on another host and recently transferred to FQ. I have noticed since the transfer that when I invoke the functionality to do the following:
[nbsp][nbsp][nbsp][nbsp][nbsp]create a directory
[nbsp][nbsp][nbsp][nbsp][nbsp]write a file into that directory (fopen, fputs, etc.)
that the operation invariably fails with the following:
"Warning: SAFE MODE Restriction in effect. The script whose uid is 42469 is not allowed to access conf/chix/sbg/site.conf owned by uid 98"
What's happening is that the directory is created successfully with the uid of the apache process, however, when the fopen, fputs functions execute, they apparently execute with the uid of my username. (Furthermore, the directory that is created by the apache process is only writeable by the owner, so I can't interact with it, which is normally not a problem since all interactivity in these directories are handled by the "app" that I have created... assuming of course that the app *can* interact with the directories, which it apparently can not.).
Naturally I can add lines that chmod the new directory so that it is writeable by group and world, however, I find it wierd that these two similar operations run under different uids.
Will I *need* to add chmod functionality to the directory creation algorithms? --or is something else amiss?
Rich.