安裝時的問題:
1.Strict Standards:?Non-static method cls_image::gd_version() should not be called statically in?/usr/local/httpd2/htdocs/upload/install/includes/lib_installer.php?on line?31
解決:找到install/includes/lib_installer.php中的第31行?? return cls_image::gd_version();
然后在找到include/cls_image.php中的678行,發現gd_version()方法未聲明靜態static,所以會出錯。
這時候只要:
1)將function gd_version()改成static function gd_version()即可(嚴重建議使用此方法!!!)。
2)或者將install/includes/lib_installer.php中的第31行return cls_image::gd_version();改成:
$p = new cls_image();
return $p->gd_version();
2.檢測環境的時候提示:是否支持 JPEG是不支持的。
解決:查看發現有libjpeg.lib庫,GD2庫也有,都加載了,也都正常。查看ecshop源代碼發現install/includes/lib_installer.php中第100行,JPEG寫成了JPG,正確的應該是:
$jpeg_enabled = ($gd_info['JPEG Support']=== true) ? $_LANG['support'] : $_LANG['not_support'];
為何說Ecshop寫錯了,因為打印數組$gd_info的時候,里面的鍵名是:JPEG Support。而$gd_info數組里的值都是直接調用系統環境變量的。
3.默認時區問題:Warning:date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in?/usr/local/httpd2/htdocs/upload/install/includes/lib_installer.php?on line?223
解決:
方法1,修改PHP配置文件。如果你服務器的主要時區是亞洲上海,那么修改這里是比較妥當的,當然更穩妥的辦法是通過.htaccess導入PHP設置。
打開PHP.INI大概在958找到; date.timezone =去掉前面的注釋;號,然后改成date.timezone =Asia/Shanghai,保存配置文件,重啟你的服務器。
方法2,在頁頭使用
ini_set('date.timezone','Asia/Shanghai');
方法3,修改\install\includes\lib_installer.php文件。在這個文件頂部<?php之內加上如下PHP代碼 :
date_default_timezone_set ('Asia/Shanghai');
登錄使用時問題
一,ECshop是基于PHP5.3以下版本開發的,由于PHP5.5版本已廢除了e模式修飾符,因此如果你使用的是PHP5.5以上環境安裝,可能會出現類似以下3種報錯
PHP 5.5. 起, 傳入 "\e" 修飾符的時候,會產生一個 E_DEPRECATED 錯誤; PHP 7.0. 起,會產生 E_WARNING 錯誤,同時 "\e" 也無法起效。
可以使用 preg_replace_callback() 代替。
1,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in?/usr/local/httpd2/htdocs/upload/includes/cls_template.php?on line?288
解決方法已經在報錯提示中,打開/usr/local/httpd2/htdocs/upload/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);
2,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line?555
定位到upload\includes\cls_template.php第555行,將
$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);
改為
$val=preg_replace_callback("/\[([^\[\]]*)\]/is",function($r){return '.'.str_replace('$','\$',$r[1]);},$val);
3,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line?1075
定位到?upload\includes\cls_template.php on line?1075,將
$pattern = '/.*?/se';
$replacement = "'{include file='.strtolower('\\1'). '}'";
$source = preg_replace($pattern, $replacement, $source);
改為一行
$source = preg_replace_callback('/.*?/s', function($r){return '{include file='.strtolower($r[]). '}';}, $source);
4,Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\php_act\11_ec\upload\includes\cls_template.php on line?496
定位到upload\includes\cls_template.php on line?496
$out = "<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));", var_export($t, true)) . ";\n";
改為
$out = "<?php \n" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/" , function($r){return stripslashes(trim($r[],'\''));}, var_export($t, true)) . ";\n";
二,PHP5.3以上默認只能傳遞具體的變量,而不能通過函數返回值傳遞
1,Strict standards: Only variables should be passed by reference in?/usr/local/httpd2/htdocs/upload/includes/cls_template.php?on line 423
定位upload/includes/cls_template.php?on line?423:
$tag_sel = array_shift(explode(' ', $tag));
改為
$tag_sel = explode(' ', $tag);
$tag_sel = array_shift($tag_sel);
2,Strict standards: Only variables should be passed by reference in F:\php_act\11_ec\upload\includes\lib_main.php on line?1329
定位到upload\includes\lib_main.php on line?1329
$ext = end(explode('.', $tmp));
改為
$_end=explode('.', $tmp);
$ext = end($_end);
三,Strict standards: Redefining already defined constructor for class XXX
此報錯是使用PHP5.4以上版本安裝ecshop可能出現的,例如本人安裝后登錄管理后臺顯示不出驗證碼這個情況:
右鍵驗證碼處點擊“復制圖片網址”后打開,便能看到這個錯誤。
打開報錯所在文件看到如下代碼:
function captcha($folder = '', $width = 145, $height = 20)
{
if (!empty($folder))
{
$this->folder = $folder;
}
$this->width = $width;
$this->height = $height;
/* 檢查是否支持 GD */
if (PHP_VERSION >= '4.3')
{
return (function_exists('imagecreatetruecolor') || function_exists('imagecreate'));
}
else
{
return (((imagetypes() & IMG_GIF) > 0) || ((imagetypes() & IMG_JPG)) > 0 );
}
}
function __construct($folder = '', $width = 145, $height = 20)
{
$this->captcha($folder, $width, $height);
}
可以看到其中使用和類名相同點函數名作為構造函數是php4時代的寫法,php5時代的構造函數是 __construct(),ecshop為了兼容老版本的php,所以采用了上面的寫法,但是從php5.4開始,對于這樣的兩種寫法同時出現的情況,要求必須__construct()在前,同名函數在后,所以只需要對調兩個函數的位置即可。
四,mktime()問題
1,Strict standards: mktime(): You should be using the time() function instead in F:\php_act\11_ec\upload\admin\sms_url.php on line?31
定位到upload\admin\sms_url.php on line?31
$auth = mktime();
改為
$auth = time();
2,?Strict standards: mktime(): You should be using the time() function instead in F:\php_act\11_ec\upload\admin\shop_config.php on line?32
定位到upload\admin\shop_config.php on line?32,修改同上
安裝office2010提示要安裝MSXML6.10.1129.0解決方法
系統win7 32位 安裝office2010出現了錯誤,提示要安裝MSXML6.10.1129.0解決方法 1.下載MSXML6.10.1129.0進行安裝 2.若本機已安裝過不管用: a.在運行里 ...
VS2008 SP1 安裝卡在 VS90sp1-KB945140-X86-CHS的解決方法
VS2008 SP1 安裝卡在 VS90sp1-KB945140-X86-CHS的解決方法 VS2008 SP1 安裝卡在 VS90sp1-KB945140-X86-CHS的解決方法 方法一:(不推薦 ...
【轉】chrome 67版本后無法拖拽離線安裝CRX格式插件的解決方法
第一種:開啟開發者模式即可?(推薦) chrome? 的設置 -> 更多工具 -> 擴展程序,開啟開發者模式即可! 第二種方法:修改參數 首先打開下面地址:chrome://flags/# ...
ubuntu安裝vmplayer出現問題的解決方法
ubuntu安裝vmplayer 出現問題的解決方法 1:ubuntu12.04安裝vmware12出現cannot ope dev/vmmon及modprobe vmmon提示密鑰無效的解決辦法 筆 ...
Tomcat安裝教程及常見錯誤解決方法
目錄 Tomcat安裝教程及常見錯誤解決方法 一.安裝前準備 ·熟悉自己電腦的操作系統版本(32位or64位) ·保證電腦上已經裝好JDK,并且已經設置好環境變量. 二.Tomcat安裝教程(以Tom ...
php5.4下安裝ECshop出現錯誤的解決辦法
轉:http://www.programmernote.com/?p=65 1.安裝是會提示 Warning: date_default_timezone_get(): It is not safe ...
安裝Mysql提示1045錯誤解決方法
MySQL安裝提示一下錯誤 The security settings could not be applied to the database because the connection has ...
Windows Server 2008 R2安裝WAMPSERVER無法啟動的解決方法
其實根本不算什么解決方法,會者不難的事.Windows Server 2008 R2(也包括其他版本的Windows)默認狀態下安裝WAMPSERVER經常是無法順利啟動WAMPSERVER的,尤其是 ...
Linux搭建python環境中cx_Oracle模塊安裝遇到的問題與解決方法
安裝或使用cx_Oracle時,需要用到Oracel的鏈接庫,如libclntsh.so.11.1,否則會有各種各樣的錯誤信息. 安裝Oracle Instant Client就可得到這個鏈接庫,避免 ...
隨機推薦
vtkQuadric創建二次曲面
在本實例中,我們將用到vtkQuadric.vtkSampleFunction.vtkContourFilter三個類,分別是二次曲面函數.函數曲面抽樣和等高濾波. vtkQuadric負責二次曲面基 ...
Spring MVC重定向和轉發及異常處理
SpringMVC核心技術---轉發和重定向 當處理器對請求處理完畢后,向其他資源進行跳轉時,有兩種跳轉方式:請求轉發與重定向.而根據要跳轉的資源類型,又可分為兩類:跳轉到頁面與跳轉到其他處理器.對于 ...
詳解 ML2 Core Plugin(I) - 每天5分鐘玩轉 OpenStack(71)
我們在 Neutron Server 小節學習到 Core Plugin,其功能是維護數據庫中 network, subnet 和 port 的狀態,并負責調用相應的 agent 在 network ...
PHP守護進程
php也是可以直接進行守護進程的啟動與終止的,相對于shell來說會簡單很多,理解更方便,當然了php的守護進程要實現自動重啟還是要依賴于shell的crontab日程表,每隔一段時間去執行一次腳本看 ...
從“程序員轉行賣燒餅”想到IT人創業
我的一個朋友最近總在跟我念叨著“我不想做開發了,整天累死累活寫程序,也攢不下幾個錢.我想辭職搞點啥!” 我問他:“你想搞點啥?”. 他說:“搞啥都比做開發強,做個網站賺廣告費,接私活……實在不行我去賣 ...
.NET中開源CMS目錄
提起開源cms,大家第一想到的是php的cms,因為php開源的最早,也最為用戶和站長們認可,隨著各大cms系統的功能的不斷完善和各式各樣的開源cms的出現,.net和java的高端的cms系統也逐漸 ...
面向新手的Webserver搭建(一)——IIS的搭建
非常多童鞋說自己是做移動開發的,想掛個簡單的Web API,但是server又不會搭,這樣一來測試就成了問題.看看網上的教程.發現略難懂,并且大多是一個轉一個,沒價值,所以干脆寫幾篇文章講講簡單的We ...
HTML meta refresh 刷新與跳轉(重定向)頁面
可用于 ...
Reverse Words in a String leetcode
Given an input string, reverse the string word by word. For example,Given s = "the sky is blue& ...
Python把給定的列表轉化成二叉樹
在LeetCode上做題時,有很多二叉樹相關題目的測試數據是用列表給出的,提交的時候有時會出現一些數據通不過,這就需要在本地調試,因此需要使用列表來構建二叉樹,方便自己調試.LeetCode上二叉樹結 ...