You are not logged in.
I am running nginx, php and php-fpm. I've been running the phpBB forums for a couple weeks. I recently updated my Arch so it is using php / php-fpm 8,2.5 and nginix 1.24 and now PHP can no longer write to the disk. Write permissions are not allowed any more. I wrote a simple php script to test this:
<?php
$filename = 'testing.txt';
$functions = [
'is_readable',
'is_writable',
'is_executable'
];
foreach ($functions as $f) {
echo 'The file ' . $filename . ' ';
echo $f($filename) ? '' : 'not';
echo ' ' . $f . '</p>';
} And I can change the permissions of testing,txt and see the changes to read and execute show up. But when I add write permission, it still says write is not allowed. What happened??
I seem to recall some kind of setting for php-fpm to allow it write access to the filesystem, but I don't recall what that was.
Last edited by jdarnold (2023-05-01 10:38:29)
Offline
I don't use php-fpm but at work what I do is have a user group for all my web php stuff and the files that I might write to are owned by that group. Maybe create a user and chown your files to be owned by that group.
Offline
I think the php-fpm service has been hardened some time ago.
Try systemctl-editing the unit and adding the BBS's base dir to ReadWritePaths=
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
I think the php-fpm service has been hardened some time ago.
Try systemctl-editing the unit and adding the BBS's base dir to ReadWritePaths=
OMG, thank you thank you THANK YOU!
This was it exactly. The latest php-fpm update must have changed this, so it is actually pretty recent. But I'm back and working.
Offline