diff --git a/lib/base.php b/lib/base.php index 7d70f98452..a019e9a000 100644 --- a/lib/base.php +++ b/lib/base.php @@ -188,7 +188,15 @@ class OC { public static function checkConfig() { $l = \OC::$server->getL10N('lib'); - $configFileWritable = file_exists(self::$configDir . "/config.php") && is_writable(self::$configDir . "/config.php"); + + // Create config in case it does not already exists + $configFilePath = self::$configDir .'/config.php'; + if(!file_exists($configFilePath)) { + @touch($configFilePath); + } + + // Check if config is writable + $configFileWritable = is_writable($configFilePath); if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled() || !$configFileWritable && \OCP\Util::needUpgrade()) { if (self::$CLI) {