多语言展示
当前在线:1008今日阅读:23今日分享:25

ecshop在php5.4版的错误代码修改

ecshop在php5.3版以上的环境下会出现很多错误,这里介绍一下怎么修改。
工具/原料

ecshop

方法/步骤
1

安装的时候出现错误Non-static method cls_image::gd_version() should not be called statically in  includes\lib_installer.php on line 31进入install/include目录打开文件 找到31行return cls_image::gd_version();修改成$p = new cls_image();return $p->gd_version();还有根目录的include目录下的lib_base.php的346行也是一样修改

2

安装完登录后台提示:Only variables should be passed by reference  includes\cls_template.php on line 406打开 includes\cls_template.php  找到406行$tag_sel = array_shift(explode(' ', $tag));改成:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);

3

出现Redefining already defined constructor for class alipay 错误,页面比较多,把构造函数__construct移到同名函数前面如:include/cls_captcha.php把function __construct($folder = '', $width = 145, $height = 20)    {        $this->captcha($folder, $width, $height);    }移到function captcha($folder = '', $width = 145, $height = 20)前面需要注意的是后台支付方式里的大多数都要做这个修改

4

打开前台页出现:Only variables should be passed by reference includes\lib_main.php on line 1329$ext = end(explode('.', $tmp));修改为: $ext = explode('.',$tmp); $ext = end($ext);

5

打开后台出现:XmlHttpRequest status:[500] Unknow status找到/admin/templates/top.htm然后删除下面的代码:找到/admin/templates/menu.htm419行删除Ajax.call('cloud.php?is_ajax=1&act=menu_api','', start_menu_api, 'GET', 'JSON');找到/admin/templates/start.htm9行删除Ajax.call('cloud.php?is_ajax=1&act=cloud_remind','', cloud_api, 'GET', 'JSON');24行删除Ajax.call('cloud.php?is_ajax=1&act=close_remind&remind_id='+id,'', cloud_api, 'GET', 'JSON');

6

后台商店设置出现You should be using the time() function instead in admin\sms_url.php on line 31admin\shop_config.php on line 32mktime()修改为  time()

7

商品批量上传出现Assigning the return value of new by reference is deprecated in admin\goods_batch.php on line 921$filter = &new stdclass;改成$filter = new stdclass;

8

会员整合出现phpbb::set_cookie() should be compatible with integrate\includes\modules\integrates\phpbb.php on line 232110行function set_cookie ($username='')修改成function set_cookie ($username='', $remember = NULL)includes\modules\integrates\phpwind6.phpucenter.php  vbb.php也是这样修改ucenter.php 210行修改成 function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '')127行修改成function login($username, $password, $remember = NULL)

9

数据库备份出现edefining already defined constructor for class cls_sql_dump\admin\includes\cls_sql_dump.php on line 90  function __construct(&$db, $max_size =0)    {        $this->cls_sql_dump($db, $max_size);    }移到function cls_sql_dump(&$db, $max_size=0)前面Non-static method cls_sql_dump::get_random_name() admin\database.php on line 64打开includes\cls_sql_dump.php 479行 function get_random_name()修改成static function get_random_name()

注意事项

其他错误再慢慢增加

推荐信息