On my site, i have a textarea where a user can write a message and submit it through a form. Then PHP writes the text to a file. This works except when the size of the texts reaches a certain point, around 5000 characters. That is when fwrite() fails. However, if the user wishes to edit that file and PHP reads the previously made one for its contents and the user simply adds more text, there is no issue and the user can continue adding chunks of text over and over indefinitely. What really confuses me is that each time the user adds more text, PHP is still rewriting the entirety of the text to the file again, and so it should be no different than writing a large file in the first place all at once. I feel as if this is a disc space issue, but I do not know how to resolve this. Thank you!
Not sure of the issue. I worked on a process yesterday that wrote 3 times that amount with no issues. fwrite() doesn’t have limitations, like you are apparently already seeing.