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. Link to comment https://forums.phpfreaks.com/topic/248455-fwrite-permission-variations-from-server-to-server/ 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. Link to comment https://forums.phpfreaks.com/topic/248455-fwrite-permission-variations-from-server-to-server/#findComment-1275929 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 Link to comment https://forums.phpfreaks.com/topic/248455-fwrite-permission-variations-from-server-to-server/#findComment-1275946 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. Link to comment https://forums.phpfreaks.com/topic/248455-fwrite-permission-variations-from-server-to-server/#findComment-1275966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.