phpbrewでPHP 7.3.1をインストールしてPHPのバージョンを上げました。
問題がないかローカル環境でWordPressの動作を確認した所、次のようなWarningが表示されていました。(確認用にローカル環境はWarningも表示する設定にしています)
Warning: preg_match(): JIT compilation failed: no more memory
PHP7.3のバグっぽい
この記事を書いたではPHP7.3のバグが原因で、解決方法としてはphp.ini
でコメントアウトされている;pcre.jit=1
をpcre.jit=0
として有効にすればいいっぽい。
php.ini
の場所
$ php --ini Configuration File (php.ini) Path: /Users/<USER_NAME>/.phpbrew/php/php-7.3.1/etc Loaded Configuration File: /Users/<USER_NAME>/.phpbrew/php/php-7.3.1/etc/php.ini
php.ini を編集する
pcre.jit
で検索して、pcre.jit=0
を追加
; Enables or disables JIT compilation of patterns. This requires the PCRE ; library to be compiled with JIT support. ;pcre.jit=1 pcre.jit=0 ; <= 追加
apacheを再起動
$ sudo apachectl restart
ブラウザをリロードしたらWordPressで表示されていたWarningは表示されなくなりました!
とはいえPHP側のバグなようなので、いずれまた修正しないとだめになりそうです... (′• દ •‵)
PHP 7.3 って2018年12月にリリースされたばかりだったんですね…
バグってやがる。早すぎたんだ…
安定版みたいに書かれてたからインストールしたのですが、リリースされてすぐのものには気を付けないとダメですね、、、
[参考]
- preg_match(): JIT compilation failed: no more memory · Issue #7836 · composer/composer · GitHub
- PHP 7.3 JIT compilation failed: no more memory · Issue #56 · lanlin/notes · GitHub
- php - Errors Installing Composer on macOS (JIT compilation Failed) - Stack Overflow
- https://qiita.com/nnahito/items/916052ff6d8bbed87070
Apache 2.4 も MySQL 8 も色々あったんだゼ... (解決したら戻さないといけないからセルフメモ

- 出版社/メーカー: サカタのタネ
- メディア: おもちゃ&ホビー
- クリック: 853回
- この商品を含むブログ (2件) を見る