I recently upgraded my Magento store to 2.3.1. The main store works just fine, however, my other store (multi-store instance) brings up this error:

Warning: stream_wrapper_unregister(): Unable to unregister protocol phar:// in /home/site/public_html/app/bootstrap.php on line 11

It then redirects to a report page, the relevant log file shows:

{"0":"Warning: Cannot modify header information - headers already sent by (output started at /home/site/public_html/app/bootstrap.php:11)}

I've cleared out the var/ folders, run the:

$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy -f
$ php bin/magento cache:clean

Going to app/bootstrap.php line 11 shows:


Commenting it out works ... but that feels hacky and dirty.

What's the proper way to fix this?

Server info:

PHP: 7.2.16

CentOS 7


  • did you got any solution for this? – Piyush Apr 12 at 10:41
  • Still looking for a solution for a very similar issue - however, when I commented out "stream_wrapper_unregister('phar');" - Checkout on mobile devices would get the spinning wheel of death. If you reloaded the page, then there was no issue. So if you have commented out the line, clear web data and cookies on your mobile and try to checkout without cached items. Maybe it's something in my setup, but I was glad I caught it and have no idea why it affects checkout on Safari. – dawhoo Apr 15 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.