• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    Highlighted
    New

    Why file can only be written the first time and subsequent writes fail?

    Problem: The first time I can write to the file no problem but any subsequent writes don't get make it through and falls into the else statement?

    I am using fopen (), fwrite() and then fclose().

     

    Other info: The site is hosted on godaddy and i have set the privacy permissions on the folder to be writable.

    What I tried: I used the function

    file_put_contents($log_file, $content . PHP_EOL, FILE_APPEND | LOCK_EX);

     Any ideas?

    1 REPLY 1
    Moderator
    Moderator

    Re: Why file can only be written the first time and subsequent writes fail?

    Hey @o38,

     

    It may help to know a little bit more about what is you're attempting to do as well as the specific type of hosting platform you're setting this up for? I'm sure with a little more detail, other members might be able to offer some suggestions to assist. 

     

    CG - GoDaddy | Community Moderator
    24/7 support available at x.co/247support