在PHP5.3以上版本運行ecshop和ecmall出現的問題及解決方案
ecshop
問題一:商城首頁報錯 Strict Standards: Only variables should be passed by reference in D:\wamp\ecshop\includes\cls_template.php on line 422
解決方法:
找到提示錯誤的文件cls_template.php及行號
把$tag_sel = array_shift(explode(' ', $tag));
改成:$tag_arr = explode(' ', $tag);$tag_sel = array_shift($tag_arr);
並且刪除D:\wamp\www\ecshop\temp\caches下所有的文件
問題二:后台首頁報錯 Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\wamp\www\ecshop\includes\lib_base.php on line 346
解決辦法
找到D:\wamp\www\ecshop\includes\cls_image.php文件
搜索function gd_version改成static function gd_version
問題三:后台-商店設置
Strict Standards: mktime(): You should be using the time() function instead in D:\wamp\www\ecshop\admin\sms_url.php on line 31Strict Standards: mktime(): You should be using the time() function instead in D:\wamp\www\ecshop\admin\shop_config.php on line 32
解決辦法
根據錯誤提示 把mktime()改成time()
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ecmall
問題描述:打開商城首頁及后台出現亂碼及以下一系列的錯誤信息
Strict Standards: Non-static method ECMall::startup() should not be called statically inD:\wamp\www\ecmall\index.phpon line22Deprecated: Assigning the return value of new by reference is deprecated inD:\wamp\www\ecmall\eccore\controller\app.base.phpon line141Deprecated: Assigning the return value of new by reference is deprecated inD:\wamp\www\ecmall\includes\ecapp.base.phpon line143Deprecated: Assigning the return value of new by reference is deprecated inD:\wamp\www\ecmall\includes\ecapp.base.phpon line149Strict Standards: Declaration of FrontendApp::jslang() should be compatible with ECBaseApp::jslang($lang) inD:\wamp\www\ecmall\app\frontend.base.phpon line365Strict Standards: Declaration of Message::display() should be compatible with FrontendApp::display($tpl) inD:\wamp\www\ecmall\eccore\controller\message.base.phpon line332
Strict Standards:Non-static method Conf::get() should not be called statically, assuming $this from incompatible context inD:\wamp\www\ecmall\app\frontend.base.phpon line 446
解決辦法
到ecmall安裝目錄下 找到ecmall/eccore/ecmall.php
把function get(改成static function get(
把function startup(給成static function startup(
到php安裝目錄下找到php.ini把error_reporting = E_ALL改成error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT重啟服務
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\WWW\eccore\view\template.php on line 1402
$pattern = array(
'//', // 替換smarty注釋
'//', // 替換不換行的html注釋
'/(href=["|\'])\.\.\/(.*?)(["|\'])/i', // 替換相對鏈接
'/((?:background|src)\s*=\s*["|\'])(?:\.\/|\.\.\/)?(images\/.*?["|\'])/is', //在images前加上$tmp_dir
'/((?:background|background-image):\s*?url\()(?:\.\/|\.\.\/)?(images\/)/is', //在images前加上$tmp_dir
'/{nocache}(.+?){\/nocache}/ise', //無緩存模塊
);
去掉后面的e
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\WWW\eccore\view\template.php on line 801
// $fields = preg_replace('/([a-zA-Z0-9_]+)\.([a-zA-Z0-9_*]+)/e', "\$this->_getFieldTable('\\1') . '.\\2'", $fields);
return preg_replace_callback("/{([a-zA-Z0-9_]+)\.([a-zA-Z0-9_*]+)}/", function($r) { return $this->_getFieldTable($r[1]); }, $fields);
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\WWW\eccore\view\template.php on line 357
// return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);