I have got the following problem since the server has safe mode turned on, and directories are being created under different users:
- I upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it can store files in it.
- New directory is created, but it belongs to 'apache' user.
- 'user1' and 'apache' are different users; and safe mode is turned on. So the php script cannot write to that newly created directory.
- Now I have a problem!
One solution is to turn off safe mode. Also, a coworker suggested that there are settings that can be changed to ensure the directories are under the same user as the script. So I am looking to see if latter can be done.
But I have to ask. Is there a programatical solution for my problem?
I am leaning to a 'no', as safe mode was implemented to solve it at the php level. Also the actual problem may seem like the directory being created under a different user, so a programatic fix might just be a band-aid fix.