LLLLLLL Posted October 5, 2011 Share Posted October 5, 2011 (This might be the wrong forum; it might be server-side configuration, but alas it is the code that *calls* fwrite, so I'll start here.) I have written a script, and one thing it does is generate a file to disk using fwrite. No big deal. Here's what interests me: On most servers, the file is written successfully when the folder's permissions are 755 with recursive permissions. On some servers, 755 fails. Only 777 works. How could this be? Are permissions=permissions=permissions? Why will 755 work on one machine but not another? I'm just a logic guy; I know very little of server-side configuration and/or why there would be a difference here. Just trying to learn. Quote Link to comment Share on other sites More sharing options...
trq Posted October 5, 2011 Share Posted October 5, 2011 Your question has nothing to do with php and is more a Linux question. 755 means that only the owner of the directory can write to it. 777 means anyone can write to it. Quote Link to comment Share on other sites More sharing options...
LLLLLLL Posted October 5, 2011 Author Share Posted October 5, 2011 Yes, as I stated above this may have been the wrong forum. I understand the difference, ownership-wise, of 755 and 777, but I'm unclear on why different servers vary their behavior regarding fwrite permissions. I guess I should have Googled; others have had this issue... http://www.css-resources.com/write-nearly-any-type-of-file-with-php.html Quote Link to comment Share on other sites More sharing options...
trq Posted October 5, 2011 Share Posted October 5, 2011 Web server run as a particular user on the system. This in turn effects what permissions the server has. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.