搜索
首页php教程php手册ECSHOP在PHP5.5及高版本上报错的解决方法

程序不断的更新换代,php版本也在不断的推陈出新,自从php7.0推出,php5.5版本已落伍,但是目前使用php5.5的也不少,接下来,小编给大家整理关于ECSHOP在PHP5.5

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…?

通过在网络上查找,小编发现并不是只能在低版本的php中安装,也是找到了解决办法,方便大家在php5.5版本上调试程序。小编就在这里把解决方法分享给大家:

先说明第一个问题的解决方法:

php 5.3以上版本的问题,,和配置有关 只要418行把这一句拆成两句就没有问题了。

将下列:

$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()

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前By尊渡假赌尊渡假赌尊渡假赌

热工具

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

SecLists

SecLists

SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版