Forum Moderators: coopster

Message Too Old, No Replies

php permissions

problem with fopen, unlink etc..

         

macdar

11:51 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



Hi there,

I need to use unlink,fopen functions. The problem is that these functions needs to be executed in subdirectories, which have 755 permissions (writable just for a user). I could change the perms manually, but I don't wanna do that - thare are too many of them..etc..

I figured that I could execute that script as a user. Since php is running as "nobody" I also changed the script's owner to nobody- but didn't really changed anything..

What am I missing here?
Can anybody help me with that issue?

Thanks.

Blackie

6:27 am on Jun 17, 2005 (gmt 0)

10+ Year Member



Do those files have read permissions?

anshul

6:41 am on Jun 17, 2005 (gmt 0)

10+ Year Member



I think, PHP won't change directory permission.
Manually change directory to 777 using CuteFTP or other similar program. You can then ofcourse, change files permission then, use chmod()
See chmod() documentation, if you stumble on it.
( Also check if PHP is running in SAFE_MODE )

If some has idea on managing directory permissions, please say to both of us.

macdar

6:17 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



Thanks guys for your responses, however I don't think you fully understood what I meant.
I don't want to change permissions for directories..
Since a user has the right to write a file to a directory(755), I want to call my script for the user..(is it really possible? )

I've overcome that issue using ftp functions, but I'm not satisfied with that solution.. so, if any of you has an idea how to deal with it, I'd really appreciate your help..

Thanks.

bennymack

6:52 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



Maybe what you're looking for is mod_suexec. That is if you have the ability to change your httpd.conf for your server.

If not, try chmod-ing the directory you need group writeable and then chgrp the directory to the group apache runs under.

anshul

7:01 am on Jun 18, 2005 (gmt 0)

10+ Year Member



We gnerally have no access to httpd.conf

>> If not, try chmod-ing the directory you need group writeable and then chgrp the directory to the group apache runs under.

Do you mean we can change directory permissions to '0777' or '0644'? What is the significance of chgrp()?