diff --git a/phpBB/install/startup.php b/phpBB/install/startup.php
index f3312d227d..0aaa9a648f 100644
--- a/phpBB/install/startup.php
+++ b/phpBB/install/startup.php
@@ -93,6 +93,21 @@ function installer_msg_handler($errno, $msg_text, $errfile, $errline)
case E_USER_ERROR:
$msg = 'General Error:
' . $msg_text . '
in file ' . $errfile . ' on line ' . $errline . '
';
+ if (!empty($phpbb_installer_container))
+ {
+ try
+ {
+ /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
+ $iohandler = $phpbb_installer_container->get('installer.helper.iohandler');
+ $iohandler->add_error_message($msg);
+ $iohandler->send_response(true);
+ exit();
+ }
+ catch (\phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception $e)
+ {
+ throw new \phpbb\exception\runtime_exception($msg);
+ }
+ }
throw new \phpbb\exception\runtime_exception($msg);
break;
case E_DEPRECATED: