FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » file_put_contents not creating file
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
file_put_contents not creating file [message #172271] Tue, 08 February 2011 22:07 Go to previous message
jwcarlton is currently offline  jwcarlton
Messages: 76
Registered: December 2010
Karma:
Member
Isn't this supposed to append OR create?

$file = "/home/mydomain/users/username/text.dat";
$post = "Test";

file_put_contents($file, $post, FILE_APPEND | LOCK_EX);

What's happening is, if the file already exists, then it appends with
no problem. But if it doesn't, then I'm getting this error:

Warning: file_put_contents(/home/mydomain/users/username/text.dat)
[function.file-put-contents]: failed to open stream: Permission denied
in/home/gowilkes/public_html/test.php on line 58

// Line 58 is the file_put_contents() line

I double checked that the directory path does exist. The permission
set for the directory is 0755, with owner/group set to 32007/32009.

TIA,

Jason
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Will this work?
Next Topic: need help to develop 2 language english and french
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 01:58:40 GMT 2024

Total time taken to generate the page: 0.03864 seconds