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 #172273 is a reply to message #172271] Tue, 08 February 2011 22:19 Go to previous messageGo to previous message
jwcarlton is currently offline  jwcarlton
Messages: 76
Registered: December 2010
Karma:
Member
On Feb 8, 5:07 pm, jwcarlton <jwcarl...@gmail.com> 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

Nevermind, now that I typed it I realized the answer; PHP is not
running as Group, so I'm sure that I need the directory to be 0666 or
0777, not 0755.

Do you guys know a way to modify PHP so that it runs as Group instead
of Owner?

Or, not a PHP topic, but do you know a Linux command that will quickly
change the permission of 90,000 directories?
[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: Sun Nov 10 15:10:29 GMT 2024

Total time taken to generate the page: 0.05353 seconds