box: Failed to open stream and cannot open phar archive

So about a week ago, I ran the box.phar no problem built a PHAR successfully with 3.8.0. However, since then, I believe I’ve changed/updated PHP versions and now I’m getting this error on PHP 7.2.21.

And for the life of me, I can’t figure out what has changed that now I can’t compile any PHARs.

In ClassLoader.php line 444:

  include(phar:///path/to/box.phar/vendor/composer/../amphp/amp/lib/Failure.php): failed to open stream: phar error: Cannot open phar archive "/path/to/box.phar" for reading


compile [-c|--config CONFIG] [--debug] [--no-parallel] [--no-restart] [--dev] [--no-config] [--with-docker] [-d|--working-dir WORKING-DIR]

PHP Fatal error:  Uncaught ErrorException: include(phar:///path/to/box.phar/vendor/composer/../amphp/process/lib/ProcessException.php): failed to open stream: phar error: Cannot open phar archive "/path/to/box.phar" for reading in phar:///path/to/box.phar/.box/vendor/composer/ClassLoader.php:444
Stack trace:
#0 phar:///path/to/box.phar/.box/vendor/composer/ClassLoader.php(444): _HumbugBox7eb78fbcc73e\KevinGH\Box\{closure}(2, 'include(phar://...', 'phar:///Users/a...', 444, Array)
#1 phar:///path/to/box.phar/.box/vendor/composer/ClassLoader.php(444): include()
#2 phar:///path/to/box.phar/.box/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('phar:///path/t...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('_HumbugBox7eb78...')
#4 phar:///path/to/box.phar/vendor/amphp/process/lib/Internal/Posix/Runner.php(134): spl_autoload_call('_HumbugBox7eb78...')
#5 phar:///path/to/bo in phar:///path/to/box.phar/.box/vendor/composer/ClassLoader.php on line 444

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

3.8.3 fixes the issue for me 🎉 Thanks @theofidry!

Could you try with 3.8.3?

Cool. Then I guess it could be dumped to a safe number beforehand as well then