设为首页收藏本站关注微信<<< 抵制 IE6 人人有责 >>>
搜索
热搜: 活动 交友 discuz
查看: 2080|回复: 1
打印 上一主题 下一主题

[其他(待整理)] ecshop在PHP 5.4以上版本报错的解决方案

[复制链接]
跳转到指定楼层
楼主
发表于 2015-4-29 06:00:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
不少朋友发现ecshop在php高版本的情况下 会出现报错

1、PHP 5.4.X环境下安装ECShop出现 includes/cls_template.php on line 406&rdquo;的解决方案。
  1. $tag_sel = array_shift(explode(' ', $tag));
复制代码

这句话拆开为两句。
  1. $tag_tmp = (explode(' ', $tag));
  2.         $tag_sel = array_shift($tag_tmp);
  3.         //$tag_sel = array_shift(explode(' ', $tag));
复制代码



array_shift() 的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值 end(&array) 也一样(后面也会有end的函数,也需要拆分为两行)。

2、PHP 5.4.X环境下安装ECShop出现
includes/lib_base.php on line 346
的解决方案。
将 cls_image.php 中
  1. function gd_version()
复制代码

改成
  1. static function gd_version()
复制代码

即可。

3、后台点击 开店向导 警告的解决方案。
admin/include/modules/payment 下的几个文件构造函数错误,删掉即可。

4、php5.4下安装的时候处理问题,
Strict Standards: Non-static method cls_image::gd_version() should not be called statically in \install\includes\lib_installer.php on line 31

解决:找到install/includes/lib_installer.php中的第31行

  1. return cls_image::gd_version();
复制代码

然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。这时候只要:
  将
  1. function gd_version()
复制代码


改成
  1. static function gd_version()
复制代码


即可。

5 安装好后出现 Strict standards: Only variables should be passed by reference in \includes\lib_main.php on line 1329
  1. $ext = end(explode('.', $tmp));
复制代码


修改为:

  1. <p>$ext = explode('.',$tmp);</p><p>$ext = end($ext);</p>
复制代码


Strict standards: Only variables should be passed by reference in \includes\cls_template.php on line 418
  1. tag_sel = array_shift(explode(' ', $tag));
复制代码


修改为:
  1. $tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
复制代码



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享淘帖
回复

使用道具 举报

沙发
 楼主| 发表于 2015-4-29 06:13:08 | 只看该作者
由于mysql5.3以上版本的配置问题在安装ecshop时总会出现一些错误,就本人遇到的错误,解决一下,如有不足还望包涵。

一、首页错误:
(1)
Strict standards: Declaration of ucenter::login() should be compatible with integrate::login($username, $password, $remember = NULL)
in ...\ecshop\includes\modules\integrates\ucenter.php on line 52



解决方法:找到ucenter.php文件   ctrl+f   查找login
找到
  1. function login($username, $password)
复制代码


改为
  1. function login($username, $password, $remember = NULL)
复制代码


ok 问题解决

(2)
Strict standards: Declaration of ucenter::add_user() should be compatible with integrate::add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '') in D:\wamp\www\vipshop\includes\modules\integrates\ucenter.php on line 52


解决方法:找到ucenter.php文件   ctrl+f   查找add_user
找到   
  1. function add_user($username, $password, $email)
复制代码


改为   
  1. function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = NULL)
复制代码


ok 问题解决

(3)
Strict standards: Declaration of ucenter::set_cookie() should be compatible with integrate::set_cookie($username = '', $remember = NULL)
in D:\wamp\www\vipshop\includes\modules\integrates\ucenter.php on line 52


同样的道理
解决方法:找到ucenter.php文件   ctrl+f   查找set_cookie
找到
  1. function set_cookie($username='')
复制代码


改为
  1. function set_cookie($username='', $remember = NULL)
复制代码

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|手机版|Archiver|源于生活(个人生活娱乐工作的笔记)css3,html5,学习笔记    

GMT+8, 2024-4-28 03:12 , Processed in 0.093600 second(s), 28 queries .

Powered by Mr.Kevin-ying

© 2004-2015

快速回复 返回顶部 返回列表