Thursday, December 27, 2018

The Work Around Solution to Composer Broken When PHP 7.3 Installed via Homebrew

How to Add Constants in Larvel 5

There was an error came out after I upgraded PHP version to 7.3. When I execute composer --version or composer update, a lot of error messages shown:

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
   :
   :

The composer was broken!

This is a known PHP 7.3 bug.

After searching the solution, somebody suggests a work around below:

  1. Edit php.ini file (locate at /usr/local/etc/php/7.3/php.ini).

  2. Disable PHP PCRE JIT compilation:

    [Pcre]
    ;pcre.jit=1 
    pcre.jit=0
    

Then the composer is alive again! It’s great!
Remember to change back to the original setting while the bug fix.

No comments:

Post a Comment