`

(转)PCRE is not compiled with PCRE_UTF8错误

php 
阅读更多

Form: http://www.dysph.net/blog/diary/599.html

 

前几天突然发现自己的两个页面和控制板中分别出现了如下的错误:

Warning: preg_match() [function.preg-match]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /home/ghouck/domains/dysph.net/public_html/blog/wp-includes/class-simplepie.php on line 11043
Warning: preg_replace() [function.preg-replace]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in /home/ghouck/domains/dysph.net/public_html/blog/wp-includes/shortcodes.php on line 228

  

Google了一下,找到的全是国外网站,稍微看了看,都是说的PHP Server问题.

自己对PHP完全不了解,不过看描述貌似是服务器上PCRE的版本无法支持UTF-8,要解决还要从Server上着手,于是联系了空间的管理员,结果他也不清楚怎么处理,无法解决…

 

还是得自己想办法,接着又翻了翻google,所幸找到一个临时的办法,万一有哪位同学遇到了同样的问题,可以试试 : )

方法如下:

打开class-simplepie.php和shortcodes.php,找到报错的那一行,将其中preg_match改为@preg_match,即

return (bool) @preg_match(…);        (括号中的内容省略)

$text = @preg_replace(…);      (括号中的内容省略)

保存后,错误提示消失.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics