leimeisei Posted October 8, 2008 Share Posted October 8, 2008 Why is this happening? I call is_writable(file that exists and is writable) and it returns nothing. This only happens on one of my servers. Why would this happen? Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/ Share on other sites More sharing options...
leimeisei Posted October 8, 2008 Author Share Posted October 8, 2008 And yes, I did a chmod 777 on all directories and files that I want writable, and confirmed my actions using ls -la (i am on linux) Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660367 Share on other sites More sharing options...
holiks Posted October 8, 2008 Share Posted October 8, 2008 It should return either true or false.......either one. Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660368 Share on other sites More sharing options...
.josh Posted October 8, 2008 Share Posted October 8, 2008 You sure the file/directory is on that server? also, if it's returning "nothing" then perhaps you should post the code context it is in. Perhaps a condition is not being met or something. Or...from the manual: Keep in mind that PHP may be accessing the file as the user id that the web server runs as (often 'nobody'). Safe mode limitations are not taken into account. Did you check that out for that server? Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660370 Share on other sites More sharing options...
leimeisei Posted October 8, 2008 Author Share Posted October 8, 2008 Safe Mode is not enabled for PHP. Also, file_exists, if used with the same file path, returns a true. Here is the code I am using for writability testing: <?php die( "Status: ".is_writable("pages/default/settings.php")); ?> The output looks like.... Status: Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660376 Share on other sites More sharing options...
holiks Posted October 8, 2008 Share Posted October 8, 2008 <?php $result = is_writable("pages/default/settings.php") ? 'writable' : 'non-writable'; die( "Status: $result"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660385 Share on other sites More sharing options...
leimeisei Posted October 8, 2008 Author Share Posted October 8, 2008 but why does it return non-writable, when the file is actually writable? Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660389 Share on other sites More sharing options...
holiks Posted October 9, 2008 Share Posted October 9, 2008 Probably because the user php is running as doesn't have permission to. Crayon Violent quoted someting to that effect in this thread. Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660401 Share on other sites More sharing options...
leimeisei Posted October 9, 2008 Author Share Posted October 9, 2008 PHP runs under user "apache". So I'm afraid I don't understand. I have marked the file writable by all. I even tried chown apache settings.php so that the user owned the file. I appreciate everyones continued help. Quote Link to comment https://forums.phpfreaks.com/topic/127625-is_writable-returns-nothing/#findComment-660419 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.