全部的錯誤,根據下面這個帖子修改php
http://bg.artuion.com/328.htmlhtml
修改錯誤:sql
第300行 dom
原有內容:函數
//return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);網站
修改後內容: ui
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);this
問題一:商城首頁報 錯 Strict Standards: Only variables should be passed by reference in D:\wamp\ecshop\includes\cls_template.php on line 422google
解決方法:url
找到提示錯誤的文件 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 31
Strict Standards: mktime(): You should be using the time() function instead in D:\wamp\www\ecshop\admin\shop_config.php on line 32
解決辦法
根據錯誤提示 把 mktime() 改爲 time()
問題四:後臺-起始頁
Strict Standards: Redefining already defined c**tructor for class alipay in D:\www\es\includes\modules\payment\alipay.php on line 85
解決辦法
1)、錯誤緣由:
PHP 類,有兩種構造函數,一種是跟類同名的函數,一種是 __contruct()。從PHP5.4開始,對這兩個函數出現的順序作了最嚴格的定義,必須是 __c**truct() 在前,同名函數在後
2)、
解決方法:
調換一下兩個函數的先後位置便可。
以 includes/modules/payment/alipay.php 爲例:
將下面這兩個函數的位置互換一下就OK了,__contruct()在前,alipay()在後
function alipay() {
}
function __contruct()
{
$this->alipay();
}
3)、ECSHOP的不少類文件 都存在這個問題,都須要修改掉。
問題五:後臺-數據備份
Strict standards: Redefining already defined constructor for class cls_sql_dump in D:\wamp\www\ecshop\admin\includes\cls_sql_dump.php on line 90
Strict standards: Non-static method cls_sql_dump::get_random_name() should not be called statically in D:\wamp\www\ecshop\admin\database.php on line 64
解決辦法
根據錯誤提示 把 cls_sql_dump的 function __construct()改到 function cls_sql_dump()的前面
把 cls_sql_dump的 function get_random_name()改爲 static function get_random_name()的前面
問題六:
Deprecated: Assigning the return value of new by reference is deprecated in \admin\sitemap.php on line 46
$sm =& new google_sitemap();
解決辦法
在 5.3版本以後已經不容許在程序中使用」=&」符號。若是你的網站出現了 Deprecated: Assigning the return value of new by reference is deprecated in 錯 誤,彆着急,先定位到出錯的文件,查找下是否是在程序中使用了」=&」,例如剛纔定位到網站程序中發現了下圖的程序,發現使用了」=&」 符號,去掉‘&’符號以後程序運行正常
問題:Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in E:\Program Files\xampps\htdocs\upload\includes\cls_template.php on line 1075
查找:
$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';
去掉那個 e !!!
修改成:
$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';
錯誤:Strict standards: Only variables should be passed by reference in \includes\lib_main.php on line 1329
查找:
$ext = end(explode('.', $tmp));
修改成:
$tmp_arr = explode('.', $tmp);
$ext = end($tmp_arr);
array_shift() 的參數是引用傳遞的,5.3以上默認只能傳遞具體的變量,而不能經過函數返回值 end(&array) 也同樣(後面也會有end的函數,也須要拆分爲兩行)。
文件includes/init.php和admin/includes/init.php:
error_reporting(E_ALL ^ (E_NOTICE)改成:
error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);