Re: is_writable() not working on PHP 5.1.6

From: Date: Fri, 05 Jan 2007 22:19:55 +0000
Subject: Re: is_writable() not working on PHP 5.1.6
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-246637@lists.php.net to get a copy of this message
On Fri, January 5, 2007 5:01 am, lists@dwsasia.com wrote: > I am running Fedora Core 6 with PHP 5.1.6 > > This little snippet will output "the file is not writable": > > if (file_exists($file)) { > if(!is_writeable($menu_filename)){ Did you really intend to switch from $file to $menu_filename ??? This *could* be the problem... > echo "the file is not writable"; > } > } else echo "The file does not exist"; > > > > I have set the permissions to 777 for the file and also put group and > user to apaches user. So that is not an issue. Are you using FULL PATHNAME for the file, or are you relying on the sometimes seemingly-random behaviour of current working directory? Use the FULL PATH and then you'll never have a problem. Other than the obvious one of moving files around and needing to change paths to match. :-) > I have seen some bug reports on this, but haven't figured out how to > solve it. Post references from http://bugs.php.net if you can. > Is this a PHP 5.1.6 related bug? I haven't seen any fix or similar. Anything is possible, but something like this usually boils down to operator error with paths/permissions, rather than an actual bug. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#246637) next »