运行CakePHP shell时出现preg_replace_callback()警告
我正在跑步: 阿帕奇2 PHP 5.3.3 森托斯 当我检查pcre时,我看到: 重新测试-C运行CakePHP shell时出现preg_replace_callback()警告,php,cakephp-2.0,cakephp-2.1,Php,Cakephp 2.0,Cakephp 2.1,我正在跑步: 阿帕奇2 PHP 5.3.3 森托斯 当我检查pcre时,我看到: 重新测试-C PCRE version 6.6 06-Feb-2006 Compiled with UTF-8 support Unicode properties support Newline character is LF Internal link size = 2 POSIX malloc threshold = 10 Default match limit = 10000000
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
但是,当尝试运行shell时,我得到以下结果:
Warning: preg_replace_callback(): Compilation failed: unrecognized character after (?< at offset 4 in /var/CakePHP/cakephp_2.0.5/lib/Cake/Console/ConsoleOutput.php on line 186
警告:preg_replace_callback():编译失败:在第186行的/var/CakePHP/CakePHP_2.0.5/lib/Cake/Console/ConsoleOutput.php中(?<在偏移量4处)之后的字符无法识别
我已经阅读了所有关于PHP版本的票证,确保pcre是最新的,并确保pcre在cakephp错误列表上有unicode支持。有没有办法解决这个问题,以便我可以在cakephp 2.0.5中运行控制台命令
更新:
对不起,这是第185行的代码:
return preg_replace_callback(
'/<(?<tag>[a-z0-9-_]+)>(?<text>.*?)<\/(\1)>/ims', array($this, '_replaceTags'), $text
);
返回preg\u replace\u回调(
“/(?*?)/ims”,数组($this,'.\u replaceTags'),$text
);
另请注意,此功能目前在其他地方可用(即在我的MacBook Pro上运行)似乎需要升级到pcre。对此有一个简单的单行修复程序。请访问以下网址查看差异:
我们可以看到实际的正则表达式正在崩溃吗?现在,这是无法回答的…确认,这为我解决了问题。这值得检查。