diff --git a/console.php b/console.php
index fb410ee6983fd..a5bcbde7231b4 100644
--- a/console.php
+++ b/console.php
@@ -39,6 +39,14 @@
return;
}
+// Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now
+// @see https://github.com/nextcloud/server/pull/5791
+if (version_compare(PHP_VERSION, '7.2.0') !== -1) {
+ echo 'This version of Nextcloud is not compatible with PHP 7.2.
';
+ echo 'You are currently running ' . PHP_VERSION . '.';
+ return;
+}
+
function exceptionHandler($exception) {
echo "An unhandled exception has been thrown:" . PHP_EOL;
echo $exception;
diff --git a/index.php b/index.php
index cd95b0c796544..686b48aaff10e 100644
--- a/index.php
+++ b/index.php
@@ -33,6 +33,14 @@
return;
}
+// Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now
+// @see https://github.com/nextcloud/server/pull/5791
+if (version_compare(PHP_VERSION, '7.2.0') !== -1) {
+ echo 'This version of Nextcloud is not compatible with PHP 7.2.
';
+ echo 'You are currently running ' . PHP_VERSION . '.';
+ return;
+}
+
try {
require_once __DIR__ . '/lib/base.php';