diff --git a/lib/private/config.php b/lib/private/config.php
index 586e8c20587d86679a6741bb1824533d6bb20353..31e536221ddaeff41a994ad42b4c2e255b7fea59 100644
--- a/lib/private/config.php
+++ b/lib/private/config.php
@@ -166,7 +166,9 @@ class Config {
 		// Include file and merge config
 		foreach ($configFiles as $file) {
 			$filePointer = @fopen($file, 'r');
-			if($file === $this->configFilePath && $filePointer === false) {
+			if($file === $this->configFilePath &&
+				$filePointer === false &&
+				@!file_exists($this->configFilePath)) {
 				// Opening the main config might not be possible, e.g. if the wrong
 				// permissions are set (likely on a new installation)
 				continue;