First, some background. I have 6 Magento 2.2.x sites on a development server. 4 of the 6 upgraded just fine. I used the same standard composer upgrade process on all of them. They're on a single apache/php environment via virtualhosts so they all have the same resources.
On 2 of them, I get this error when trying to compile (edited to remove the domain):
Warning: stream_wrapper_unregister(): Unable to unregister protocol phar:// in [DOCUMENT ROOT PATH]/html/app/bootstrap.php on line 11
I can't seem to get any further information about where the issue actually is. I've reset the files & database to pre-upgrade state and it compiles fine (one is 2.2.7, the other is 2.2.5) -- but if I repeat the upgrade, then it errors again.
Any information about how to troubleshoot further would be greatly appreciated.