关于ECSHOP模板架设的服务器php版本过高报错的解决方法集合
2015-10-30 00:58
686 查看
1、admin/index.php
admin/sms_url.php
报错:StrictStandards:mktime():Youshouldbeusingthetime()functioninsteadin/data/web/ledetaoadmin/sms_url.phponline31
替换为:
报错:StrictStandards:Onlyvariablesshouldbepassedbyreferencein/data/web/includes/lib_main.phponline1336
2、lib_main.php
替换为:
继续报错
Warning:end()expectsparameter1tobearray,nullgivenin/data/web/includes/lib_main.phponline1336
将刚刚的代码改成:
3、cls_template.php
替换为:
4、cls_captcha.php
移动到:
前面
5、admin\includes\cls_sql_dump.php
移动到:
前面
StrictStandards:Redefiningalreadydefinedconstructorforclasschinabankin/data/web/includes/modules/payment/chinabank.phponline85
StrictStandards:Redefiningalreadydefinedconstructorforclasspaypal_ecin/data/web/includes/modules/payment/paypal_ec.phponline96
StrictStandards:Redefiningalreadydefinedconstructorforclassshenzhouin/data/web/includes/modules/payment/shenzhou.phponline81
StrictStandards:Redefiningalreadydefinedconstructorforclassipsin/data/web/includes/modules/payment/ips.phponline82
StrictStandards:Redefiningalreadydefinedconstructorforclassbalancein/data/web/includes/modules/payment/balance.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclassalipayin/data/web/includes/modules/payment/alipay.phponline85
StrictStandards:Redefiningalreadydefinedconstructorforclasstenpayin/data/web/includes/modules/payment/tenpay.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasspostin/data/web/includes/modules/payment/post.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclasspaypalin/data/web/includes/modules/payment/paypal.phponline82
StrictStandards:Redefiningalreadydefinedconstructorforclasstenpayc2cin/data/web/includes/modules/payment/tenpayc2c.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasscappayin/data/web/includes/modules/payment/cappay.phponline81
StrictStandards:Redefiningalreadydefinedconstructorforclassbankin/data/web/includes/modules/payment/bank.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclasskuaiqianin/data/web/includes/modules/payment/kuaiqian.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasscodin/data/web/includes/modules/payment/cod.phponline82
解决办法:
将所有的构造函数放到前面:
如alipay.php
将
放到
前面
在安装Ecshop的时候,遇到两个问题:
1.StrictStandards:Non-staticmethodcls_image::gd_version()shouldnotbecalledstaticallyinD:\X\www\ecshop\install\includes\lib_installer.phponline31
解决:找到install/includes/lib_installer.php中的第31行returncls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。这时候只要:
1)将functiongd_version()改成staticfunctiongd_version()即可。
2)或者将install/includes/lib_installer.php中的第31行returncls_image::gd_version();改成:
$p=newcls_image();
return$p->gd_version();
2.检测环境的时候提示:是否支持JPEG是不支持的。
解决:查看发现有libjpeg.lib库,GD2库也有,都加载了,也都正常。查看ecshop源代码发现install/includes/lib_installer.php中第100行,JPEG写成了JPG,正确的应该是:
$jpeg_enabled=($gd_info['JPEGSupport']===true)?$_LANG['support']:$_LANG['not_support'];
为何说Ecshop写错了,因为我打印数组$gd_info的时候,里面的键名是:JPEGSupport。而$gd_info数组里的值都是直接调用系统环境变量的。
3.默认时区问题:Warning:date_default_timezone_get():Itisnotsafetorelyonthesystem'stimezonesettings.Youare*required*tousethedate.timezonesettingorthedate_default_timezone_set()function.Incaseyouusedanyofthosemethodsandyouarestill
gettingthiswarning,youmostlikelymisspelledthetimezoneidentifier.Weselectedthetimezone'UTC'fornow,butpleasesetdate.timezonetoselectyourtimezone.inD:\X\www\ecshop\install\includes\lib_installer.phponline225
解决:方法1,将php.ini里是date.timezone前的";"去掉,改成:date.timezone=PRC;
方法2,在页头使用ini_set('date.timezone','Asia/Shanghai');
方法3,在页头使用date_default_timezone_set()设置date_default_timezone_set('PRC');//东八时区echodate('Y-m-dH:i:s');
admin/sms_url.php
报错:StrictStandards:mktime():Youshouldbeusingthetime()functioninsteadin/data/web/ledetaoadmin/sms_url.phponline31
1 | $auth = mktime (); |
1 | $auth = time(); |
2、lib_main.php
1 | $ext = end ( explode ( '.' , $tmp )); |
1 | $ext = end (); |
2 | $ar = explode ( '.' , $tmp ); |
3 | $ext = end ( $ar ); |
Warning:end()expectsparameter1tobearray,nullgivenin/data/web/includes/lib_main.phponline1336
将刚刚的代码改成:
1 | $arr = array (); |
2 | $ext = end ( $arr ); |
3 | $ar = explode ( '.' , $tmp ); |
4 | $ext = end ( $ar ); |
1 | $tag_sel = array_shift ( explode ( ' ' , $tag )); |
1 | $tag_arr = explode ( ' ' , $tag ); |
2 | $tag_sel = array_shift ( $tag_arr ); |
01 | /** |
02 | * 构造函数 |
03 | * |
04 | * |
05 | * @param |
06 | * |
07 | * |
08 | */ |
09 | function __construct( $folder = '' , $width = $height = 20) |
10 | { |
11 | $this ->captcha( $folder , $width , $height ); |
12 | } |
1 | /** |
2 | * 构造函数 |
3 | * |
4 | * |
5 | * @paramstring$folder背景图片所在目录 |
6 | * @paraminteger$width图片宽度 |
7 | * @paraminteger$height图片高度 |
8 | * |
9 | */ |
5、admin\includes\cls_sql_dump.php
01 | /** |
02 | * 类的构造函数 |
03 | * |
04 | * |
05 | * @param |
06 | * |
07 | * |
08 | */ |
09 | function __construct(& $db , $max_size =0) |
10 | { |
11 | $this ->cls_sql_dump( $db , $max_size ); |
12 | } |
1 | /** |
2 | * 类的构造函数 |
3 | * |
4 | * |
5 | * @param |
6 | * |
7 | * |
8 | */ |
StrictStandards:Redefiningalreadydefinedconstructorforclasschinabankin/data/web/includes/modules/payment/chinabank.phponline85
StrictStandards:Redefiningalreadydefinedconstructorforclasspaypal_ecin/data/web/includes/modules/payment/paypal_ec.phponline96
StrictStandards:Redefiningalreadydefinedconstructorforclassshenzhouin/data/web/includes/modules/payment/shenzhou.phponline81
StrictStandards:Redefiningalreadydefinedconstructorforclassipsin/data/web/includes/modules/payment/ips.phponline82
StrictStandards:Redefiningalreadydefinedconstructorforclassbalancein/data/web/includes/modules/payment/balance.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclassalipayin/data/web/includes/modules/payment/alipay.phponline85
StrictStandards:Redefiningalreadydefinedconstructorforclasstenpayin/data/web/includes/modules/payment/tenpay.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasspostin/data/web/includes/modules/payment/post.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclasspaypalin/data/web/includes/modules/payment/paypal.phponline82
StrictStandards:Redefiningalreadydefinedconstructorforclasstenpayc2cin/data/web/includes/modules/payment/tenpayc2c.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasscappayin/data/web/includes/modules/payment/cappay.phponline81
StrictStandards:Redefiningalreadydefinedconstructorforclassbankin/data/web/includes/modules/payment/bank.phponline79
StrictStandards:Redefiningalreadydefinedconstructorforclasskuaiqianin/data/web/includes/modules/payment/kuaiqian.phponline83
StrictStandards:Redefiningalreadydefinedconstructorforclasscodin/data/web/includes/modules/payment/cod.phponline82
解决办法:
将所有的构造函数放到前面:
如alipay.php
将
1 | function __construct() |
2 | { |
3 | $this ->alipay(); |
4 | } |
1 | function alipay() |
2 | { |
3 | } |
在安装Ecshop的时候,遇到两个问题:
1.StrictStandards:Non-staticmethodcls_image::gd_version()shouldnotbecalledstaticallyinD:\X\www\ecshop\install\includes\lib_installer.phponline31
解决:找到install/includes/lib_installer.php中的第31行returncls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。这时候只要:
1)将functiongd_version()改成staticfunctiongd_version()即可。
2)或者将install/includes/lib_installer.php中的第31行returncls_image::gd_version();改成:
$p=newcls_image();
return$p->gd_version();
2.检测环境的时候提示:是否支持JPEG是不支持的。
解决:查看发现有libjpeg.lib库,GD2库也有,都加载了,也都正常。查看ecshop源代码发现install/includes/lib_installer.php中第100行,JPEG写成了JPG,正确的应该是:
$jpeg_enabled=($gd_info['JPEGSupport']===true)?$_LANG['support']:$_LANG['not_support'];
为何说Ecshop写错了,因为我打印数组$gd_info的时候,里面的键名是:JPEGSupport。而$gd_info数组里的值都是直接调用系统环境变量的。
3.默认时区问题:Warning:date_default_timezone_get():Itisnotsafetorelyonthesystem'stimezonesettings.Youare*required*tousethedate.timezonesettingorthedate_default_timezone_set()function.Incaseyouusedanyofthosemethodsandyouarestill
gettingthiswarning,youmostlikelymisspelledthetimezoneidentifier.Weselectedthetimezone'UTC'fornow,butpleasesetdate.timezonetoselectyourtimezone.inD:\X\www\ecshop\install\includes\lib_installer.phponline225
解决:方法1,将php.ini里是date.timezone前的";"去掉,改成:date.timezone=PRC;
方法2,在页头使用ini_set('date.timezone','Asia/Shanghai');
方法3,在页头使用date_default_timezone_set()设置date_default_timezone_set('PRC');//东八时区echodate('Y-m-dH:i:s');
相关文章推荐
- php利用smtp类实现电子邮件发送
- 纯php生成随机密码
- php搜索文件程序分享
- php三种实现多线程类似的方法
- php验证邮箱和ip地址最简单方法汇总
- php链接SQL_Server数据库
- 过滤utf8 字符中超过三个字节的字符,或者非utf8字符
- PHP开发环境之WAMP独立安装
- PHP实现异步调用方法研究
- 自定义ContentProvider
- 52. PHP 伪静态
- vsftpd 匿名用户只读不写的原因
- Yii2.0 search 搜索类
- 编码你个坑
- PHP set_error_handler() 函数
- 关于VC6的map文件和RTP文件
- php在.php文件中设置php.ini,仅对当前文件有效
- PHP TSRM(线程安全管理)详解
- Contentprovider获取联系人id和姓名
- PHP实现二分法查找(递归)