From bdf89dc92712baf248f57d646fa33f59e35eb156 Mon Sep 17 00:00:00 2001 From: Adam Outler Date: Sat, 10 Jan 2026 04:42:22 +0000 Subject: [PATCH] Enable PHP running as root --- install/production-filesystem/services/start-php-fpm.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install/production-filesystem/services/start-php-fpm.sh b/install/production-filesystem/services/start-php-fpm.sh index 81a245ce..0f829650 100755 --- a/install/production-filesystem/services/start-php-fpm.sh +++ b/install/production-filesystem/services/start-php-fpm.sh @@ -28,6 +28,13 @@ trap forward_signal INT TERM echo "Starting /usr/sbin/php-fpm83 -y \"${PHP_FPM_CONFIG_FILE}\" -F (tee stderr to app.php_errors.log)" php_fpm_cmd=(/usr/sbin/php-fpm83 -y "${PHP_FPM_CONFIG_FILE}" -F) + +#In the event PUID is 0 we need to run php-fpm as root +#This is useful on legacy systems where we cannot provision root access to a binary +if [[ $(id -u) -eq 0 ]]; then + php_fpm_cmd+=(-R) +fi + "${php_fpm_cmd[@]}" 2> >(tee -a "${LOG_APP_PHP_ERRORS}" >&2) & php_fpm_pid=$!