Php writing to file - empty ?

Posted by The Devil on Stack Overflow See other posts from Stack Overflow or by The Devil
Published on 2011-02-06T16:22:16Z Indexed on 2011/02/06 23:25 UTC
Read the original article Hit count: 289

Filed under:
|
|
|

Hey,

I've been struggling with writing a single string into a file. I'm using just a simple code under Slackware 13:

$fp = fopen('/my/absolute/path/data.txt', 'w');
fwrite($fp, 'just a testing string...');
fclose($fp);

The file gets created (if it's not already created) but it's empty ?! The directory in which this file is written is owned by apache's user & group (daemon.daemon) and has 0777 permissions. This has never happened to me before. I'm curious what's the reason I'm not able to write inside the file ?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about file