play_ Posted October 24, 2007 Share Posted October 24, 2007 First i try this: <?php chmod('./images/loading.gif', 0777); ?> and i get: Warning: chmod(): Operation not permitted in /path/here/fstat.php on line 2 So then I think that maybe i have to switch to the directory im in, and then try. So i try the following: <?php chdir('./images/'); chmod('loading.gif', 0777); ?> Warning: chmod(): Operation not permitted in /path/here/fstat.php on line 3 I've searched this forums, none of the topic on this provided a usable answer. ps: running this code: <?php $file = fopen("./images/loading.gif", 'r'); $fstats = fstat($file); $file_uid = $fstats['uid']; $my_uid = getmyuid(); print "File is owned by $file_uid, my uid is $my_uid\n"; ?> returns: File is owned by 644, my uid is 644 Quote Link to comment https://forums.phpfreaks.com/topic/74644-chmod-operation-not-permitted/ Share on other sites More sharing options...
effigy Posted October 24, 2007 Share Posted October 24, 2007 What uid does the server run as? Quote Link to comment https://forums.phpfreaks.com/topic/74644-chmod-operation-not-permitted/#findComment-377298 Share on other sites More sharing options...
play_ Posted October 24, 2007 Author Share Posted October 24, 2007 It works if i manually change the server's permissions through the FTP client. Would it be a big risk leaving images folder @ 0777? @ effigy: Don't know. how do i find out? Quote Link to comment https://forums.phpfreaks.com/topic/74644-chmod-operation-not-permitted/#findComment-377304 Share on other sites More sharing options...
effigy Posted October 24, 2007 Share Posted October 24, 2007 If it's Apache, check the User directive in httpd.conf. Wide open permissions can always be a risk. Even if you're the only user on the box, you could do something silly that affects files you didn't intend. Quote Link to comment https://forums.phpfreaks.com/topic/74644-chmod-operation-not-permitted/#findComment-377309 Share on other sites More sharing options...
play_ Posted October 25, 2007 Author Share Posted October 25, 2007 If i am looking at the right place, next to User it says my username that i use to login to the hosting account. And right below that, the Group. which is also my login name. Quote Link to comment https://forums.phpfreaks.com/topic/74644-chmod-operation-not-permitted/#findComment-377457 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.