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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write permissions

Status
Not open for further replies.

sirugo

Programmer
Aug 1, 2000
162
SE
I have a php script that produces text files. A directory in the web folder is assigned for this reason. Someone said that the directory must must be given write permission for "all" for it to work. Is it true? Is there no way to turn php into a "owner" who has those permissions which limits write permissions rather than giving to everyone?
 
The directory does not have to have world write permissions.

Basically, the user that invokes the script must have write permission. If the script is being invoked by a web server, then the user as which your web server runs must have write permission.


Want the best answers? Ask the best questions! TANSTAAFL!
 
Is there no way to turn php into a "owner" who has those permissions which limits write permissions rather than giving to everyone?
Sure there is - but it would require you to reconfigure the web server.

As sleipnir214, you just need the account as which PHP is running to have write permissions to the directory. You can accomplish that by changing the user PHP runs as, changing the group/owner of the directory, or changing the permissions on the directory to world-writable. Which of these choices is feasible depends on how much control you have over the server. The last choice is typically the only one that doesn't require root access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top