警告:preg_replace():编译失败:在偏移量 -1 处设置了未知的选项位


Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset -1

我最近将我的专用服务器升级到Apache 2.4.6,MySQL 5.5.32和PHP 5.4.21。现在在我的网站上,我收到此错误:

警告:preg_replace():编译失败:未知选项位设置为偏移量 -1 在/home/champion/public_html/wp-include/shortcodes.php 第 295 行

以下是短代码中的代码.php在第 295 行:

$text = preg_replace("/['x{00a0}'x{200b}]+/u", " ", $text);

preg_replace函数是否与新的 PHP 5.4.21 不兼容?

将 PCRE 版本更新到 8.21 已解决此问题。