diff --git a/src/Framework/Prerequisites/Prerequisites.php b/src/Framework/Prerequisites/Prerequisites.php index c0929b4..b107fe2 100644 --- a/src/Framework/Prerequisites/Prerequisites.php +++ b/src/Framework/Prerequisites/Prerequisites.php @@ -171,13 +171,22 @@ class Prerequisites { private function checkStoragePermissions() { // Issue a warning if running as root in CLI context - if ($this->isCli && posix_getuid() === 0) { + // Write out guidance for storage directory permissions + // if running the CLI script as root (since it will always appear to be writable) + if ($this->isCli && function_exists('posix_getuid') && posix_getuid() === 0) { $this->addCheck( 'Root User Warning', false, 'Running as root - permission checks may be inaccurate. After setup, ensure storage/ is owned by your web server user', 'warning' ); + } elseif ($this->isCli && !function_exists('posix_getuid')) { + $this->addCheck( + 'POSIX Extension', + false, + 'POSIX extension not available - cannot detect if running as root', + 'warning' + ); } $storageDirs = array( @@ -526,24 +535,6 @@ class Prerequisites { } } - // Write out guidance for storage directory permissions - // if running the CLI script as root (since it will always appear to be writable) - if ($this->isCli && function_exists('posix_getuid') && posix_getuid() === 0) { - $this->addCheck( - 'Root User Warning', - false, - 'Running as root - permission checks may be inaccurate. After setup, ensure storage/ is owned by your web server user', - 'warning' - ); - } elseif ($this->isCli && !function_exists('posix_getuid')) { - $this->addCheck( - 'POSIX Extension', - false, - 'POSIX extension not available - cannot detect if running as root', - 'warning' - ); - } - if ($this->isCli && function_exists('posix_getuid') && posix_getuid() === 0) { $this->log("\nšŸ“‹ ROOT USER SETUP RECOMMENDATIONS:"); $this->log("After uploading to your web server,");