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
Re: file_put_contents not creating file [message #172275 is a reply to message #172271] Tue, 08 February 2011 22:58 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
jwcarlton wrote:
> 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
So what permissions is PHP running with then? sounds like apache (for
example) doesn't have create perms in the directory.
[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: Tue Nov 26 23:05:49 GMT 2024

Total time taken to generate the page: 0.04342 seconds