PHP: Disable PrivateTmp

Rocky Linux uses PrivateTmp to give each process it's own walled off section of /tmp/. This is good for security sometimes, but it also lead to frustration because files written to /tmp/ or /var/tmp/ will not show up when you need to debug something. To disable PrivateTmp for php-fpm you need to modify the systemd configuration for php-fpm. This is done by running systemctl edit php-fpm and adding a section that says:

[Service]
PrivateTmp=false

Once the change is in place you will need to systemctl daemon-reload and then restart systemctl restart php-fpm.

Note: Borrowed from Stack Overflow.

Leave A Reply
All content licensed under the Creative Commons License