Published: March 31, 2021
Last updated:

Blank screen & empty logs after upgrade to OpenMage

Blank screen or empty page is shown in Frontend or Backend after upgrade to OpenMage with PHP5.6. There are no any PHP errors logged, PHP error, system.log and exception.log are empty.

Cause

The cause is incompatibility with PHP5.6 introduced by replacing logging of Exceptions with Throwable in commit 5dee1c0988e5ebd7fb458d6b72163c69a545c53f merged into 1.9.4.x tree in November 2020 and included into v19.4.9 release:
diff --git a/app/Mage.php b/app/Mage.php
index 360fb12..016a496 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -905,9 +905,9 @@ final class Mage
     /**
      * Write exception to log
      *
-     * @param Exception $e
+     * @param Throwable $e
      */
-    public static function logException(Exception $e)
+    public static function logException(Throwable $e)
     {
         if (!self::getConfig()) {
             return;
@@ -941,9 +941,9 @@ final class Mage
     /**
      * Display exception
      *
-     * @param Exception $e
+     * @param Throwable $e
      */
-    public static function printException(Exception $e, $extra = '')
+    public static function printException(Throwable $e, $extra = '')
     {
         if (self::$_isDeveloperMode) {
             print '<pre>';



Solution

Switch your PHP version to PHP 7.3+ (PHP7.0 is minimal version and PHP7.3 is current recommended version) prior to OpenMage upgrade.

If changing PHP version is not possible due to some reason you can temporarily revert this patch to return Mage ability to report errors and print exceptions and re-apply it back when PHP/OS upgrade issues are sorted out.

Note, there were a few other PHP5.6 incompatible changes in OpenMage 1.9.4.x tree. There is a php56-compat fork with up-to-date changes merged with mainstream 1.9.4.x tree.

Posted in: Troubleshooting

2 votes, 3.00 avg. rating (63% score)