2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PHPでpreg_replaceのエラーが出て動かない

Posted at

PHPをアップデートしたら以下のエラーがでるようになって、Webアプリが動かなくなりました。

preg_replace(): Compilation failed: unrecognised compile-time option bit(s) at offset 0

おかしいと思って調べたら、libpcreの問題らしいことが分かりました。

ChromebookのLinux環境だったので、以下のようにライブラリをアップデートしたら直りました。

sudo apt install libpcre2-8-0
sudo apt install libpcre2-16-0

参考

https://stackoverflow.com/questions/70040287/php7-4-
preg-replace-compilation-failed-unrecognised-compile-time-option-bi

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?