1,統一解決
php.ini中的配置 error_reporting = E_ALL | E_STRICT
這是說,顯示那些不符合編碼規範的警告(coding standards warnings)。
建議取消error的輸出,若是出於調試須要,應改成
error_reporting = E_ALL & ~E_NOTICE
2.首頁出現報錯:Only variables should be passed by referen
找到出錯行(includescls_template.php 文件的418行)
$tag_sel = array_shift(explode(‘ ‘, $tag));
改爲:
$tag_bak = explode(‘ ‘, $tag);
$tag_sel = array_shift($tag_bak);
由於array_shift的參數是引用傳遞的,5.3以上默認只能傳遞具體的變量,而不能經過函數返回值,後臺更新緩存後正常。
另外一個地方一樣修改(includeslib_main.php」文件的1329行):
//$ext = end(explode(‘.’, $tmp));
$ext_bak = explode(‘.’, $tmp);
$ext = end($ext_bak); php
3.Strict Standards: Non-static method cls_image::gd_version() should not be called statically
找到出錯行(includeslib_base.php」文件的346行)
return cls_image::gd_version();
改爲:
$p = new cls_image();
return $p->gd_version();
是由於gd_version()方法未聲明靜態static,因此會出錯。 緩存
4. Strict standards: mktime(): You should be using the time() function instead
錯誤行:$auth = mktime();
PHP手冊裏http://cn2.php.net/manual/en/function.mktime.php有個Note:
As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead.
自從PHP5.1起,調用這個函數不傳遞參數,會出現一個 notice 函數
批量替換mktime()爲@mktime()便可 編碼