Permission denied with fopen() and fwrite() in Docker LAMP stack

I am glad you got help even though you forgot to use code block for the code so a big part of your post was hidden. I edited your original post so the screenshots are visible and your PHP code is readable. Please, always format your post as described in the following topic: