【2019/01/09現在】Mac PHP7.3にて、composerがPHP Fatal error: Uncaught ErrorException: preg_match_all(): JIT compilation failed: no more memory

PHP
PHP7.3
Mac

PHP7.3をbrewを使ってMacに入れたのですが、人柱になりました。
composerを使おうとすると、以下のエラーが出ます。

PHP Fatal error:  Uncaught ErrorException: preg_match_all(): JIT compilation failed: no more memory

調べて見ると、バグっぽいですね。

ひとまずの回避策

php.iniのpcre.jitを0にします。

やってみる

php.iniの場所

$ php -i | grep php.ini

コヤツを叩けば出てくるはず。
自分の環境では「/usr/local/etc/php/7.3/php.ini」でした。

編集する

sudo vim /usr/local/etc/php/7.3/php.ini

多分以下のような記述の場所があるはず。

 ; Enables or disables JIT compilation of patterns. This requires the PCRE
 ; library to be compiled with JIT support.
 ;pcre.jit=1

なので、これを変えてあげましょう

 ; Enables or disables JIT compilation of patterns. This requires the PCRE
 ; library to be compiled with JIT support.
 ;pcre.jit=1
 pcre.jit=0         ; ←追加

これでOK。
もしこれでもコケるようであれば、sudo apachectl restartをしてあげる。