Edit report at http://bugs.php.net/bug.php?id=53658&edit=1

 ID:                 53658
 Updated by:         ras...@php.net
 Reported by:        pierregobin at free dot fr
 Summary:            is_writable returns always false
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Linux 2.6.35
 PHP Version:        5.3SVN-2011-01-05 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

Are you absolutely sure your web server is running as user apache?  Do a
"ps -aux 

| grep httpd" or "ps aux | grep apache" and see which user it is running
as.  

is_writable works fine everywhere as far as I know.


Previous Comments:
------------------------------------------------------------------------
[2011-01-05 22:38:05] pierregobin at free dot fr

Description:
------------
When php script is run via apache is_writable always returns false :



'is_writable()' always returns 'false' whatever :

- the permission write sets or not.

- safe_mode on or off

- the owner of the file being root:root or apache:apache



on the other side, 'is_readable()' returns the correct value (either
'true' when the file is made readable or 'false' when the file is made
unreadable). 



But, when the same script is run by the php command line (under root) -
is_writable returns the correct value.

Test script:
---------------
<?php

if (is_writable("toto")) {

        echo "is_writable<br>";

} else {

        echo "is not writable!!!<br>";

}

?>

Expected result:
----------------
is_writable in case 'toto' is writable

is not writable in case 'toto' is not writable



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53658&edit=1

Reply via email to