原因:
php5.5以后的preg_replace不再支持e模式修饰符,可以用preg_replace_callback函数替换。
解决办法:
找到文件 Smarty_Compiler.class.php 第270行:
/* replace special blocks by "{php}" */
$source_content = preg_replace($search.'e', "'"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "'"
, $source_content);
替换为:
// 解决:preg_replace(): The /e modifier is deprecated, use preg_replace_callback ins
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "';")
, $source_content);