Skip to content

Instantly share code, notes, and snippets.

@shengslogar
Created November 19, 2021 17:07
Show Gist options
  • Save shengslogar/04f1a3de36ff7cadecdaa8dbbb868025 to your computer and use it in GitHub Desktop.
Save shengslogar/04f1a3de36ff7cadecdaa8dbbb868025 to your computer and use it in GitHub Desktop.
Uncaught ErrorException: preg_match_all(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in phar:///usr/local/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php:137

If you're getting the following error, chances are you need to upgrade libpcre2, because it's being held back for some reason (you should see this listed when you run sudo apt update, followed by upgrade).

PHP Fatal error:  Uncaught ErrorException: preg_match_all(): Compilation failed: unrecognised compile-time option bit(s) at offset 0 in phar:///usr/local/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php:137
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle()
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php(137): preg_match_all()
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Output/Output.php(155): Symfony\Component\Console\Formatter\OutputFormatter->format()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Output/Output.php(132): Symfony\Component\Console\Output\Output->write()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(641): Symfony\Component\Console\Output\Output->writeln()
#5 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(127): Symfony\Component\Console\Application->renderException()
#6 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(128): Symfony\Component\ in phar:///usr/local/bin/composer/vendor/symfony/console/Formatter/OutputFormatter.php on line 137

sudo apt dist-upgrade should resolve this, but may break some dependencies. Use at your own risk.

See: https://askubuntu.com/questions/601/the-following-packages-have-been-kept-back-why-and-how-do-i-solve-it oerdnj/deb.sury.org#1674 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment