When I run composer --version
in the macOS terminal, I get the following errors.
PHP Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php on line 755
Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php
on line 755 PHP Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php on line 759
Warning: preg_match(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php
on line 759 PHP Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php on line 654
Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php
on line 654 PHP Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php on line 1091
Warning: preg_split(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php
on line 1091 PHP Warning: preg_replace(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Formatter/OutputFormatter.php on line 36
Warning: preg_replace(): JIT compilation failed: no more memory in phar:///usr/local/bin/composer.phar/vendor/symfony/console/Formatter/OutputFormatter.php
on line 36
[ErrorException] preg_match_all(): JIT compilation failed: no more memory
This is a known PHP 7.3 bug, which has already been fixed.
As a temporary workaround, edit your php.ini file (in my case: vi /usr/local/etc/php/7.3/php.ini
), disable PHP PCRE JIT compilation by changing:
;pcre.jit=1
to
pcre.jit=0
I solved this by disabling the PCRE jit compilation.
I suppose you installed php 7.3 through homebrew.
If so, create a zzz-myphp.ini
in /usr/local/etc/php/7.3/conf.d
with the following content:
; My php.ini settings
; Fix for PCRE "JIT compilation failed" error
[Pcre]
pcre.jit=0
Other answers suggest disabling PCRE JIT via a configuration file. That works, but caveat: this disables PCRE JIT for all engine invocations that use those INI files. You therefore won't be getting JIT improvement for a potentially wider swath of functionality, which may not be desired.
You can disable JIT for composer
only via:
php -d pcre.jit=0 composer.phar ...
In PHP 7.1.24 there is no 'pcre.jit'
in php.ini file so you have to set
memory_limit:128M
(if you increase this).
It work for me by follow steps:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With