ECSHOP在PHP5.5及高版本上报错的解决方法_PHP
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("/{([^

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Alipay PHP...

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

An official introduction to the non-blocking feature of ReactPHP in-depth interpretation of ReactPHP's non-blocking feature has aroused many developers' questions: "ReactPHPisnon-blockingbydefault...
