diff --git a/public.php b/public.php index a9365d6db6393..32157a1a907ba 100644 --- a/public.php +++ b/public.php @@ -27,6 +27,25 @@ * along with this program. If not, see * */ + + +// Show warning if a PHP version below 5.6.0 is used, this has to happen here +// because base.php will already use 5.6 syntax. +if (version_compare(PHP_VERSION, '5.6.0') === -1) { + echo 'This version of Nextcloud requires at least PHP 5.6.0
'; + echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'; + 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'; diff --git a/remote.php b/remote.php index 8e74967365df5..62aa077f48056 100644 --- a/remote.php +++ b/remote.php @@ -32,6 +32,23 @@ use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\Server; +// Show warning if a PHP version below 5.6.0 is used, this has to happen here +// because base.php will already use 5.6 syntax. +if (version_compare(PHP_VERSION, '5.6.0') === -1) { + echo 'This version of Nextcloud requires at least PHP 5.6.0
'; + echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'; + 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; +} + + /** * Class RemoteException * Dummy exception class to be use locally to identify certain conditions