Ecshop却没来得及修改,如果在高版本的php虚拟主机上安装ecshop程序,出现兼容性问题。
小编在本地环境php5.5上安装出现以下两种报错提示:
Only variables should be passed by reference php
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead…"htmlcode">
$tag_sel = array_shift(explode(' ', $tag));
修改为:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值
第二个报错解决办法:
找到文件:include/cls_template.php
将以下代码:
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
修改成:
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);
小编目前只遇到这样两个报错,如果在程序调试和开发过程中遇到其他的问题,如果能够解决,小编也是会整理出解决方法的。
ecshop 在高版本PHP下报错的解决方法
1 .ecshop提示Strict Standards: Non-static method cls_image
::gd_version() should not be called statically inE:/wwwroot/weirenchou/includes/lib_base.php on line 346
找到346行吧
return cls_image::gd_version()
替换成:
$p = new cls_image();return $p->gd_version();
2 .ecshop的时候出现如下错误:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /ecshop/includes/cls_template.php on line 300
打开ecshop的目录找到includes/cls_template.php 到第300行
把
return preg_replace("/{([^/}/{/n]*)}/e", "/$this->select('//1');", $source);
替换成
return preg_replace_callback("/{([^/}/{/n]*)}/", function($r) { return $this->select($r[1]); }, $source);
3. Strict Standards: Only variables should be passed by reference in E:/web/shopex/includes/cls_template.php on line 422
$tag_sel = array_shift(explode(' ', $tag));
改成:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
4 .会员整合出现
phpbb::set_cookie() should be compatible with integrate /includes/modules/integrates/phpbb.php on line 232 110行 function set_cookie ($username="")
修改成
function set_cookie ($username="", $remember = NULL) includes/modules/integrates/phpwind6.php
ucenter.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)
5. 数据库备份出现
edefining already defined constructor for class cls_sql_dump /admin/includes/cls_sql_dump.php on line function __construct(&$db, $max_size =) { $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()
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 廖也欧《面朝大海》[Hi-Res][24bit 48kHz][FLAC/分轨][170.14MB]
- s13T1夺冠五人名单都有谁 s13T1夺冠五人名单一览
- 英雄联盟T1战队队长都有谁 T1战队所有队长介绍
- skt历届战队成员都有哪些 skt历届战队成员名单盘点
- 妙音唱片《大热唱片3》[WAV+CUE]
- 费玉清《跟着地球旋转》滚石时代经典复刻[正版原抓WAV+CUE]
- 罗文甄妮-射雕英雄传(AMCD)(限量版)[WAV+CUE]
- 《巫师4》定档2025再添佐证:参演人员曝光 老将回归
- 辣眼睛 美女COS《黑神话:悟空》比基尼版金池长老
- 外媒称PS5pro违背承诺:《蜘蛛侠2》根本没法4K60帧
- 令晴 Lynn《The Make》[320K/MP3][44.47MB]
- 令晴 Lynn《The Make》[Hi-Res][24bit 48kHz][FLAC/分轨][295.42MB]
- 雷婷《移情别恋HQⅡ》头版限量编号[低速原抓WAV+CUE][1G]
- FUNDAMENTAL.1989-感觉号渡轮【SONY】【WAV+CUE】
- 上山安娜.1986-上山安娜【EMI百代】【WAV+CUE】