Ecshop卻沒來得及修改,如果在高版本的phphtml' target='_blank'>虛擬主機上安裝ecshop程序,出現兼容性問題。小編在本地環境php5.5上安裝出現以下兩種報錯提示:Only variables should be passed by reference php Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead… 通過在網絡上查找,小編發現并不是只能在低版本的php中安裝,也是找到了解決辦法,方便大家在php5.5版本上調試程序。小編就在這里把解決方法分享給大家:先說明第一個問題的解決方法: php 5.3以上版本的問題,和配置有關 只要418行把這一句拆成兩句就沒有問題了。 將下列:$tag_sel = array_shift(explode(' ', $tag));修改為:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);因為array_shift的參數是引用傳遞的,5.3以上默認只能傳遞具體的變量,而不能通過函數返回值第二個報錯解決辦法:找到文件:include/cls_template.php將以下代碼:return preg_replace("/{([^/}/{/n]*)}/e", "/$this- select('//1');", $source);修改成:return preg_replace_callback("/{([^/}/{/n]*)}/", function($r) { return $this- select($r[1]); }, $source);小編目前只遇到這樣兩個報錯,如果在程序調試和開發過程中遇到其他的問題,如果能夠解決,小編也是會整理出解決方法的。ecshop 在高版本PHP下報錯的解決方法1 .ecshop提示Strict Standards: Non-static method cls_image::gd_version() should not be called statically inE:/wwwroot/weirenchou/includes/lib_base.php on line 346找到346行吧return cls_image::gd_version()替換成:$p = new cls_image();return $p- gd_version();2 .ecshop的時候出現如下錯誤:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /ecshop/includes/cls_template.php on line 300打開ecshop的目錄找到includes/cls_template.php 到第300行把return preg_replace("/{([^/}/{/n]*)}/e", "/$this- select('//1');", $source);替換成return preg_replace_callback("/{([^/}/{/n]*)}/", function($r) { return $this- select($r[1]); }, $source);3. Strict Standards: Only variables should be passed by reference in E:/web/shopex/includes/cls_template.php on line 422$tag_sel = array_shift(explode(' ', $tag));改成:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);4 .會員整合出現phpbb::set_cookie() should be compatible with integrate/includes/modules/integrates/phpbb.php on line 232function set_cookie ($username="")修改成function set_cookie ($username="", $remember = NULL)includes/modules/integrates/phpwind6.phpucenter.php vbb.php也是這樣修改ucenter.php 210行修改成 function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '')127行修改成function login($username, $password, $remember = NULL)5. 數據庫備份出現edefining already defined constructor for class cls_sql_dump/admin/includes/cls_sql_dump.php on line function __construct(&$db, $max_size =) $this- cls_sql_dump($db, $max_size);移到function cls_sql_dump(&$db, $max_size=0)前面Non-static method cls_sql_dump::get_random_name() admin/database.php on line 64打開includes/cls_sql_dump.php479行function get_random_name()修改成static function get_random_name()PHP教程