I was using PHP as CGI on an apache webserver. Back then I was writing to text files using scripts. But flush() did not work.
To make flush() work I changed to php as "apache module". Now flush works, but I cannot access the files anymore(permission denied).
How can I both use flush and access the files I used before?
You need to ensure that the apache user has write permissions on the files and directory you will be using.
The user can be different when running fcgi than module