Re: Problem with the fwrite function (not as simple as it sounds though)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2005-11-20 at 05:44, Łukasz Hejnak wrote:
> Hello again, here's some more extra info on my case that came out while 
> Suhas Pharkute was helping me find a resolution:
> So the safe-mode is off, that's for sure, I turned it off at compile stage.
> 
> I delete the file after each run of the script, the folder  where the 
> script is located has 777 permissions and the ownership is given to uid 
> 1027 gid 1020, whereas these are the uid/gid set for apache to run with 
> (and it does!).
> The script:
> 
> $data="some data";
> $file="file.txt";
> $handle = fopen($file,"w");
> fwrite($handle,$data);
> fflush($handle);
> fclose($handle);
> if (is_writable($file))
> 	echo "Is writable<br>";
> else
> 	echo "Isn't writable<br>";
> 
> works when I run it as root, from the shell (php script.php),
> but when it's run from the server, it doesn't.


I missed the beginning of this thread...

You are saying:

>From the CLI you can write to a file all day long, no prob.
>From the web, if the file does not exist it is created, however, no
content is appended to it. Furthermore, IF there is content in the file
it can be appended to via web, but if it's an empty file it will not get
written too. Am I following correctly?

-Brian


-- 

s/:-[(/]/:-)/g


Brian        GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux