推广 热搜: page  使用  音视频  个数  选择  搜索引擎  企业  百度  可以  父亲 

ecshop2.7.3在PHP5.3以上版本的服务器环境中运行出现的问题及解决方案

   日期:2024-12-27     作者:ir44e    caijiyuan   评论:0    移动:http://ww.kub2b.com/mobile/news/13412.html
核心提示:ecshop2.7.3是在php5.2环境下开发的老网店系统了,现在很多服务器环境已经升级为PHP5.3或php5.4甚至更好的了,那么在php5.3以上

ecshop2.7.3是在php5.2环境下开发的老网店系统了,现在很多服务器环境已经升级为PHP5.3或php5.4甚至更好的了,那么在php5.3以上版本的服务器环境中运行出现必然出现很多兼容问题,万维景盛工程师为您分享解决方法:

问题一:商城首页报错 Strict Standards: only variables should be passed by reference in D:wampecshopincludescls_template.php on line 422

解决方法:

找到提示错误的文件 cls_template.php 及行号

把 $tag_sel = array_shift(explode(' ', $tag));

改成:

$tag_arr = explode(' ', $tag);

$tag_sel = array_shift($tag_arr);

并且删除 D:wampwwwecshop empcaches下所有的文件

问题二:后台首页报错 Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:wampwwwecshopincludeslib_base.php on line 346

解决办法

找到D:wampwwwecshopincludescls_image.php文件

搜索 function gd_version 改成 static function gd_version

问题三:后台-商店设置

Strict Standards: mktime(): You should be using the time() function instead in D:wampwwwecshopadminsms_url.php on line 31

Strict Standards: mktime(): You should be using the time() function instead in D:wampwwwecshopadminshop_config.php on line 32

解决办法

根据错误提示 把 mktime() 改成 time()

问题四:后台-起始页

Strict Standards: Redefining already defined constructor for class alipay in D:wwwesshopincludesmodulespaymentalipay.php on line 85

解决办法

1)、错误原因:

PHP 类,有两种构造函数,一种是跟类同名的函数,一种是 __contruct()。从PHP5.4开始,对这两个函数出现的顺序做了最严格的定义,必须是 __construct() 在前,同名函数在后

2)、解决方法:

调换一下两个函数的前后位置即可。

以 includes/modules/payment/alipay.php 为例:

将下面这两个函数的位置互换一下就OK了,__contruct()在前,alipay()在后

function alipay() {

}

function __contruct()

{

$this->alipay();

}

3)、ECSHOP的很多类文件 都存在这个问题,都需要修改掉。

问题五:后台-数据备份

Strict standards: Redefining already defined constructor for class cls_sql_dump in D:wampwwwecshopadminincludescls_sql_dump.php on line 90

Strict standards: Non-static method cls_sql_dump::get_random_name() should not be called statically in D:wampwwwecshopadmindatabase.php on line 64

解决办法

根据错误提示 把 cls_sql_dump的 function __construct()改到 function cls_sql_dump()的前面

把 cls_sql_dump的 function get_random_name()改成 static function get_random_name()

问题六:

Deprecated: Assigning the return value of new by reference is deprecated in adminsitemap.php on line 46

$sm =& new google_sitemap();

解决办法

在5.3版本之后已经不允许在程序中使用”=&”符号。如果你的网站出现了Deprecated: Assigning the return value of new by reference is deprecated in 错误,别着急,先定位到出错的文件,查找下是不是在程序中使用了”=&”,例如刚才定位到网站程序中发现了下图的程序,发现使用了”=&”符号,去掉‘&’符号之后程序运行正常

问题七:

Declaration of phpbb::set_cookie() should be compatible with integrate::set_cookie...

解决办法:把function set_cookie ($username="") 改为function set_cookie ($username="", $remember = NULL)即可

问题八:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in..

解决办法:

我遇见了有两处,都在cls_template.php文件中:

1、return preg_replace("/{([^}{ ]*)}/e", "$this->sel ect('\1');", $source);

替换为

return preg_replace_callback("/{([^}{ ]*)}/", function($r) { return $this->sel ect($r[1]); }, $source);

问题解决。

2、$val = preg_replace("/[([^[]]*)]/eis", "'.'.str_replace('$','$','\1')", $val);

替换为

$val= preg_replace_callback("/[([^[]]*)]/eis",function($r){return str_replace('$','$',$r[1]);}, $val);

问题解决

本文地址:http://ww.kub2b.com/news/13412.html     企库往 http://ww.kub2b.com/ ,  查看更多

特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。

 
 
更多>同类最新文章
0相关评论

文章列表
相关文章
最新动态
推荐图文
最新文章
点击排行
网站首页  |  关于我们  |  联系方式  |  使用协议  |  版权隐私  |  网站地图  |  排名推广  |  广告服务  |  积分换礼  |  网站留言  |  RSS订阅  |  违规举报  |  鄂ICP备2020018471号