Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHMOD problem

Status
Not open for further replies.

porto2001

Programmer
Mar 7, 2001
24
PT
I need to change the the permissions of a directory in my ftp server. I use:

$directory = "../pagescsd";
chmod ($directory, 0777);

Warning: chmod failed: Operation not permitted in ...

I read some information about this problem, the web server typically runs as a low access account, such as "nobody" on Unix, but i need to know if there is any change to go around it.

Thanks...
 
Who owns the directory? Unless the file is owned by the user as which PHP runs, or unless the file is owned by a group of which PHP's user is a member, you can't change the permissions on the file.

As a general rule, too, you should not grant world write privileges to anything. Want the best answers? Ask the best questions: TANSTAAFL!
 
I know that i should't grant write privileges, but i need to upload a file to a directory, and my goal is to give privilege to upload the file and then take it away.

And i think the only way i can resolve is to create a connection to the ftp, change de permissions and then disconnect. I think is the only way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top