diff --git a/lib/base.php b/lib/base.php
index a32ed460907f2d371f138b6f83be543dd1bb67c7..e3b6a58bb2d1cef8e86c9f3be4c5617486cc9e8c 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -467,11 +467,11 @@ class OC {
 		stream_wrapper_register('close', 'OC\Files\Stream\Close');
 		stream_wrapper_register('oc', 'OC\Files\Stream\OC');
 
+		self::initTemplateEngine();
 		self::checkConfig();
 		self::checkInstalled();
 		self::checkSSL();
 		self::initSession();
-		self::initTemplateEngine();
 
 		$errors = OC_Util::checkServer();
 		if (count($errors) > 0) {