Table of Contents
ECSHOP在PHP5.5及高版本上报错的解决方法,ecshopphp5.5
Home Backend Development PHP Tutorial Solutions to ECSHOP error reports on PHP5.5 and higher versions, ecshopphp5.5_PHP tutorial

Solutions to ECSHOP error reports on PHP5.5 and higher versions, ecshopphp5.5_PHP tutorial

Jul 13, 2016 am 09:44 AM
ecshop php version

ECSHOP在PHP5.5及高版本上报错的解决方法,ecshopphp5.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));
Copy after login
Copy after login

修改为:

$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
Copy after login
Copy after login

因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值

第二个报错解决办法:

找到文件:include/cls_template.php

将以下代码:

return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
Copy after login

修改成:

return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);
Copy after login

小编目前只遇到这样两个报错,如果在程序调试和开发过程中遇到其他的问题,如果能够解决,小编也是会整理出解决方法的。

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
Copy after login

找到346行吧

return cls_image::gd_version()
Copy after login

替换成:

$p = new cls_image();return $p->gd_version();
Copy after login

2 .ecshop的时候出现如下错误:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /ecshop/includes/cls_template.php on line 300
Copy after login

打开ecshop的目录找到includes/cls_template.php 到第300行

return preg_replace("/{([^/}/{/n]*)}/e", "/$this->select('//1');", $source);
Copy after login

替换成

return preg_replace_callback("/{([^/}/{/n]*)}/", function($r) { return $this->select($r[1]); }, $source);
Copy after login

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));
Copy after login
Copy after login

改成:

$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
Copy after login
Copy after login

4 .会员整合出现

phpbb::set_cookie() should be compatible with integrate

/includes/modules/integrates/phpbb.php on line 232

110行

function set_cookie ($username="")
Copy after login

修改成

function set_cookie ($username="", $remember = NULL)

includes/modules/integrates/phpwind6.php
Copy after login

ucenter.php vbb.php也是这样修改

ucenter.php 210行修改成

 function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '')
Copy after login

127行修改成

function login($username, $password, $remember = NULL)
Copy after login

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);

  }
Copy after login

移到function cls_sql_dump(&$db, $max_size=0)前面

Non-static method cls_sql_dump::get_random_name() admin/database.php on line 64
Copy after login

打开includes/cls_sql_dump.php

479行

function get_random_name()
Copy after login

修改成

static function get_random_name()
Copy after login

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1050136.htmlTechArticleECSHOP在PHP5.5及高版本上报错的解决方法,ecshopphp5.5 Ecshop却没来得及修改,如果在高版本的php虚拟主机上安装ecshop程序,出现兼容性问题。...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP version development history (1995-2022) PHP version development history (1995-2022) Jun 01, 2020 pm 01:59 PM

As a PHP learner and developer, how can I not understand its history? The following PHP Chinese website will lead PHP enthusiasts to review the various historical versions of PHP.

What is the architecture of ecshop? What is the architecture of ecshop? Feb 23, 2023 am 09:32 AM

ecshop is a "B2C" architecture; ecshop is a B2C independent online store system, suitable for enterprises and individuals to quickly build personalized online stores; the system is a cross-platform open source program developed based on PHP language and MYSQL database architecture.

What are the methods for sorting ecshop articles? What are the methods for sorting ecshop articles? Jun 16, 2023 am 11:30 AM

How to sort ecshop articles: 1. Sort by publication time, you can control the order of articles in the list by modifying the publication time of the article; 2. Sort by clicks, you can achieve this sorting by installing the "Article Click Ranking" plug-in Function, this plug-in can count the number of clicks on articles; 3. Sort by the number of comments, you can implement this sorting function by installing the "Article Comment Ranking" plug-in, which can count the number of comments on articles; 4. Sort by relevance, This sorting function can be achieved by installing the "Search Ranking" plug-in.

Pagoda Panel Tutorial: A Simple Guide to PHP Version Switching Pagoda Panel Tutorial: A Simple Guide to PHP Version Switching Mar 05, 2024 am 09:27 AM

Pagoda Panel is a powerful and easy-to-use server management panel that can help users easily manage websites, databases, FTP and other services. In the process of using the Pagoda Panel, sometimes you need to switch the PHP version to adapt to different website needs. This article will provide you with a simple guide for PHP version switching, and provide specific code examples to help readers quickly complete the PHP version switching operation. First, we need to log in to the Pagoda panel and enter the website settings page. Find the "Website" option in the left navigation bar and click

What are the characteristics of ecshop? What are the characteristics of ecshop? Feb 13, 2023 am 09:43 AM

Features: 1. Open source system with flexibility, customizability and high scalability; 2. Support independent secondary development; 3. Rich templates and plug-ins; 4. Strong industry adaptability; 5. Avoid being constrained by software vendors; 6. Stronger reliability and stability; 7. Mobile H5 framework upgrade, based on VUE comprehensive replacement, more flexible and open; 8. Multi-level rebate function, supporting QR codes, posters and other promotion methods, unlimited fission development of distributors ; 8. The visual interaction of the management terminal is completely renewed, the UI is simple and beautiful, and the operating experience is upgraded; 9. Supports PHP7.2, and the performance is doubled.

Ecshop product management advanced: learn how to add fields Ecshop product management advanced: learn how to add fields Mar 12, 2024 pm 02:06 PM

Ecshop Product Management Advanced: Learn how to add fields, you need specific code examples. When using Ecshop for product management, you often encounter situations where you need to add some custom fields to meet specific needs. By adding fields, more precise product management and better user experience can be achieved. This article will introduce how to add fields in Ecshop and provide specific code examples. First, we need to clarify the need to add fields. For example, we need to add a "production date" field to the product details page to

What program is ecshop? What program is ecshop? Feb 16, 2023 am 10:38 AM

ECShop is a B2C independent online store system. It is a cross-platform open source program developed based on PHP language and MYSQL database architecture. It is suitable for enterprises and individuals to quickly build personalized online stores. The characteristics of the ecshop mall system: 1. Support independent secondary development; 2. Rich templates and plug-ins; 3. Strong industry adaptability; 4. Avoid being constrained by software vendors; 5. Stronger reliability and stability.

Pagoda Panel Operation Guide: Sharing PHP Version Switching Tips Pagoda Panel Operation Guide: Sharing PHP Version Switching Tips Mar 04, 2024 am 10:42 AM

BTPanel is a powerful and easy-to-use server management panel that can help users easily manage servers, websites, databases and other services. As a website developer or administrator, it is very important to master the skills of switching PHP versions in the Pagoda panel. In this article, we will share how to operate and switch PHP versions in the Pagoda panel, and provide specific code examples to help readers better master this skill. 1. Log in to the Pagoda panel. First, enter the server IP address or domain name in the browser, and add the Pagoda

See all articles