diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 78613ddbb0c28..cbe152db70ab8 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -40,6 +40,7 @@ */ namespace OC; +use Composer\Semver\Semver; use OCP\App\IAppManager; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; @@ -138,6 +139,9 @@ public function upgrade(): bool { $success = true; try { + if (PHP_INT_SIZE < 8 && Semver::satisfies($currentVersion, '> 25')) { + throw new HintException('You are running a 32-bit PHP version. Cannot upgrade to Nextcloud 26 and higher. Please switch to 64-bit PHP.'); + } $this->doUpgrade($currentVersion, $installedVersion); } catch (HintException $exception) { $this->log->error($exception->getMessage(), [