From 2eefef20ed8ecc2f12bd2fdf2c3dfcaf7a288bb5 Mon Sep 17 00:00:00 2001 From: Filippo Tessarotto Date: Thu, 19 Apr 2018 08:42:30 +0200 Subject: [PATCH] posix_geteuid only exists on Linux --- framework/caching/FileCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/caching/FileCache.php b/framework/caching/FileCache.php index 919a05a5893..08f292084e9 100644 --- a/framework/caching/FileCache.php +++ b/framework/caching/FileCache.php @@ -144,7 +144,7 @@ protected function setValue($key, $value, $duration) // If ownership differs the touch call will fail, so we try to // rebuild the file from scratch by deleting it first // https://github.com/yiisoft/yii2/pull/16120 - if (is_file($cacheFile) && fileowner($cacheFile) !== posix_geteuid()) { + if (is_file($cacheFile) && function_exists('posix_geteuid') && fileowner($cacheFile) !== posix_geteuid()) { @unlink($cacheFile); } if (@file_put_contents($cacheFile, $value, LOCK_EX) !== false) {