Odd permissions-like Panel issue, but permissions seem good

I’m having trouble with the Panel. I’ve installed Kirby and got it successfully working, served by Caddy with php-fpm. The panel, though, is having some problems.

Whenever I try to create a new page, it tells me “the page file could not be created.” However, it creates the page (with no file) fine; checking the pages list shows it’s invisible, and I can access the page if I move it to visible.

Trying to edit the page pops up an error saying “The page could not be updated.”

All the permissions for the files under site/ are 775. I’ve got no clue why it can’t create the files properly.

Any tips?

Edit: further investigation shows that it’s creating the page directories with permissions set to 654. Not sure why they’re not group writable, but I think that’s the cause of the issue.

Edit 2:
getfacl results for the content directory:

# file: .
# owner: apache
# group: apache
user::rwx
group::rwx
other::r-x
default:user::rw-
default:group::rw-
default:other::r--

getfacl results for newly created broken page directory:

# file: how-the-fuck
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
default:user::rw-
default:group::rw-
default:other::r--

The mystery deepens…

Do you still have this issue? If so, try removing the @ sign in front of file_put_contents in this file. There should then be a warning from PHP somewhere in the error log if you enabled it.