ecshop在PHP 5.4以上版本各种错误问题处理

在php5.4版本之后有很多的函数与功能进行丢弃与升级功能了,现在国内很多CMS都还未按php5.4标准来做了,下面我整理了一些在ecshop在PHP 5.4以上版本各种错误问题处理.

1、PHP 5.4.X环境下安装ECShop出现“includes/cls_template.php on line 406”的解决方案。
将 $tag_sel = array_shift(explode(‘ ‘, $tag)); 这句话拆开为两句。
$tag_arr = explode(‘ ‘, $tag);
$tag_sel = array_shift($tag_arr);
array_shift() 的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值 end(&array) 也一样(后面也会有end的函数,也需要拆分为两行)。
2、PHP 5.4.X环境下安装ECShop出现“includes/lib_base.php on line 346”的解决方案。
将 cls_image.php 中 function gd_version() 改成 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行   return cls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。这时候只要:
将function gd_version()改成static function gd_version()即可。
5、安装好后出现 Strict standards: Only variables should be passed by reference in \includes\lib_main.php on line 1329
$ext = end(explode('.', $tmp));
修改为:
$ext = explode('.',$tmp);
$ext = end($ext);
6、Strict standards: Only variables should be passed by reference in \includes\cls_template.php on line 418
tag_sel = array_shift(explode(' ', $tag));
修改为:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
7、ECSHOP后台“商店设置”报错 Strict Standards: mktime(): You should be using the time() function instead in /www/web/zhuli/public_html/admin/sms_url.php on line 31。
php版本问题  mktime()修改为  time()
8、 ECSHOP后台“商店设置”报错 Strict Standards: mktime(): You should be using the time() function instead in /www/web/zhuli/public_html/admin/shop_config.php on line 32。
php版本问题  mktime()修改为  time()


3 安装好后出现 Strict standards: Only variables should be passed by reference in \includes\lib_main.php on line 1329
$ext = end(explode('.', $tmp));
修改为:
$ext = explode('.',$tmp);
$ext = end($ext);
Strict standards: Only variables should be passed by reference in \includes\cls_template.php on line 418
tag_sel = array_shift(explode(' ', $tag));
修改为:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
 
array_shift() 的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值 end(&array) 也一样(后面也会有end的函数,也需要拆分为两行)。
 
修改后到后台更新缓存
 
4 后台 Strict standards: Redefining already defined constructor for class alipay in \includes\modules\payment\alipay.php on line 85
后台更新缓存
 
5 Strict standards: mktime(): You should be using the time() function instead in \admin\sms_url.php on line 31
php版本问题  mktime()修改为  time()
 
6 Strict standards: Redefining already defined constructor for class alipay in \includes\modules\payment\alipay.php on line 85Call Stack
这里是php4与php5的区别
PHP4中构造方法是一个与类同名的方法,而从PHP5开始,用__construct()做为构造方法,但仍然支持PHP4的构造方法。如果同时使用的话,如果 同名方法在前的话,则会报错

只需要把 function __construct()移到同名函数之前

7 Deprecated: Assigning the return value of new by reference is deprecated in  \admin\sitemap.php on line 46

$sm     =& new google_sitemap();

     在5.3版本之后已经不允许在程序中使用”=&”符号。如果你的网站出现了Deprecated: Assigning the return value of new by reference is deprecated in 错误,别着急,先定位到出错的文件,查找下是不是在程序中使用了”=&”,例如阿兹猫刚才定位到网站程序中发现了下图的程序,发现使用了”=&”符号,去掉‘&’符号之后程序运行正常。
 
8  PHPStrict Standards: Declaration of ucenter::login() should be compatible with integrate::login($username, $password, $remember = NULL) in \includes\modules\integrates\ucenter.php on line 52 PHP 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 \includes\modules\integrates\ucenter.php on line 52 PHP Strict Standards: Declaration of ucenter::set_cookie() should be compatible with integrate::set_cookie($username = '', $remember = NULL) in \includes\modules\integrates\ucenter.php on line 52
 
PHP5.4,子类的方法名如果和父类方法名相同,则子类的参数列表也要和父类的参数列相同。
修改接口文件里面的方法
 
9  ecshop2.7.3 gbk版在php5.4下安装后,分类名称文字不显示问题
htmlspecialchars()从 php5.4.0 版本开始第三个参数字符串编码的默认值改成了 UTF-8,而ecshop2.7.3 gbk版的中文编码是 GB2312 编码的,跟现在的默认参数不一致,导致所有htmlspecialchars()处理的字符都无法显示。
解决办法:
$str_converted = htmlspecialchars($str, ENT_COMPAT ,'GB2312');
建议php5.4下不要安装gbk编码ecshop。

转载于:https://www.cnblogs.com/zhengyanbin2016/p/5489097.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/403803.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【SRX】折腾了半天终于我的那对SRX210 升级到了 12.1R1.9

SRX brach产品一般 唯一的好处就是 学习机中的战斗机 安全特性 路由 MPLS VPLS 全方位支持 最近可以研究一下 和Zebos 的互通 改改Zebos 7.9.1的code转载于:https://www.cnblogs.com/abacuspix/archive/2012/08/07/2627364.html

BOM中的那点事-location

现在来了解一下JavaScript中的location对象。location记录了页面文档的位置信息,当然这个位置不是地址位置,而是指web中的文档位置。location其实是一个很特殊的对象,首先它是window的属性,同时也是document的属性,换句…

python多线程编程(7):线程间通信

From: http://www.cnblogs.com/holbrook/archive/2012/03/21/2409031.html 很多时候,线程之间会有互相通信的需要。常见的情形是次要线程为主要线程执行特定的任务,在执行过程中需要不断报告执行的进度情况。前面的条件变量同步已经涉及到了线程间的通…

vue本地下载文件,解决ie浏览器本地下载文件无反应(已解决);vue-cli2本地下载文件,vue-cli3本地下载文件

1.vue-cli2vue 注意&#xff1a;vue-cli2本地文件需要放在静态文件static下<a href"javascript:void(0);" click"download">帮助文档</a>download(){axios.get(static/export.pdf, {responseType: blob, //重要}).then(response > {//判断…

CSS position 笔记+实验

目录&#xff1a;1.static2.relative3.absolute4.fixed5.实验&#xff1a;static, relative, absolute中&#xff0c;父元素-子元素高度关系6.z-index7.参考资料1.static默认的定位方式&#xff0c;不支持设置位移属性用来覆盖之前创建的 absolute, relative, fixed 2.relative…

Linux 查找指定文件并删除

find . -name *.png | xargs rm -fr

python多线程编程(8):线程的合并和后台线程

From: http://www.cnblogs.com/holbrook/archive/2012/03/21/2410120.html 线程的合并 python的Thread类中还提供了join()方法&#xff0c;使得一个线程可以等待另一个线程执行结束后再继续运行。这个方法还可以设定一个timeout参数&#xff0c;避免无休止的等待。因为两个线…

修改ant design vue中的Icon图标颜色

直接行内式即可 <a-icon type"file-text" style"color: rgba(28, 106, 235, 1)" />

学习进度条10

学习进度条 第 十一 周 星期一 星期二 星 期 三 星期四 星期五 星期六 所花时间 90 100 50 42 代码量 0 120 博客量 1 1 1 了解到的知识点 初次了解到典型用户和场景 进行对自己模块设定典型用例 复习了…

批量同时创建邮箱和AD账户

前面我写了关于批量创建AD账户的BLOG,http://mcmvp.blog.51cto.com/5497438/959289也写了用UI批量启用邮件的方法&#xff0c;http://mcmvp.blog.51cto.com/5497438/959314但是这还是要执行两步&#xff0c;我们能不能只要执行一下&#xff0c;AD账户建立成功&#xff0c;邮箱跟…

I/O多路转换 select

Linux驱动部分我们曾经使用了poll机制完成了在应用层代码读取按键值。这节课介绍的select也很相似。当我们要监控好几个文件描述符的读写呢&#xff1f;如果我们阻塞的去处理其中一个&#xff0c;那第二个怎么办呢&#xff1f;下面我们一起想想办法。 方法一&#xff1a;使用fo…

Python使用select实现异步通信

From: http://www.linuxidc.com/Linux/2014-02/97152.htm 当一个服务器需要与多个客户端进行通信时&#xff0c;可以使用多进程或者多线程的服务器&#xff0c;也可以使用select模块&#xff0c;它可以实现异步通信。Python中的select模块包含了poll()和select(),select的原型…

ant design vue中通知提醒框Notification的使用

效果&#xff1a;点击接口&#xff0c;出现提示弹框&#xff0c;数据获取到后在消失 <template><a-button type"primary" click"openNotification">Open the notification box</a-button> </template> <script> const clo…

Cocos2d-3.x目录介绍分析

一、下载cocos2d的框架 1.下载地址&#xff1a;http://www.cocos2d-x.org/download/version#Cocos2d-x 我们还是选择v3.11吧 比较新的框架 2.下载之后解压这个文件夹就可以了 cocos2d-x-3.11.zip这使我们下载的文件 解压之后&#xff1a; 3. 文件夹目录如图 接下来我们逐步来介…

Mongodb Replica Configure

Mongodb Replica Configure我在配置replica的时候&#xff0c;文档中也把官网的中一些重要解释放在里面了但是并没有用中文做必要的解释&#xff0c;不过都是很容易理解的。说一下环境&#xff0c;这里的环境是&#xff1a;system:centos 64bit 生产环境不用说&#xff0c;直接…

网络IPC非阻塞和异步I/O

通常&#xff0c;recv函数没有数据可用时会阻塞等待。同样地。当套接字输出队列没有祖公空间用来发送消息时&#xff0c;函数send会阻塞。在套接字非阻塞模式下&#xff0c;行为会改变。这种情况下&#xff0c;这些函数不会阻塞而失败&#xff0c;设置errno为EWOULDBLOCK或者EA…

Python网络编程中的select 和 poll I/O复用的简单使用

From: http://www.cnblogs.com/coser/archive/2012/01/06/2315216.html 首先列一下&#xff0c;sellect、poll、epoll三者的区别 select select最早于1983年出现在4.2BSD中&#xff0c;它通过一个select()系统调用来监视多个文件描述符的数组&#xff0c;当select()返回后&…

深拷贝与浅拷贝Object.assign()

深拷贝与浅拷贝 Object.assign()会身拷贝一个复杂类型 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title…