What should I do if ecshop reports an error under php5.4?

藏色散人
Release: 2023-03-08 11:00:02
Original
2258 people have browsed it

Solution to the error reported by ecshop under php5.4: 1. Open the "cls_template" file and modify "$tag_sel=array_shift(explode(' ',$tag));"; 2. Modify "static "; 3. Modify the cls_captcha file.

What should I do if ecshop reports an error under php5.4?

The operating environment of this tutorial: Windows 7 system, PHP version 5.4, Dell G3 computer.

A collection of ECSHOP website error problems in the PHP5.4 environment

An error message appears when running the Ecshop homepage:

The following words appear:

  Strict Standards: Only variables should be passed by reference in D:\**\includes\cls_template.php on line 406 第406行:$tag_sel = array_shift(explode(' ', $tag));
Copy after login

Solution 1 The problem with versions 5.3 5.4 and above should also be related to configuration. As long as line 406 is split into two sentences, there will be no problem

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

Change to:

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

 ( Experimented, absolutely feasible) Because the parameters of array_shift are passed by reference, only specific variables can be passed by default in 5.3 and above, and cannot be passed through function return values. Solution: Remember to clear the cache after modification.

[Recommended study: "PHP Video Tutorial"]

2. Includes/lib_base.php on appears when installing ECshop in php5.4 environment Solution for line 346.

Change function gd_version() in cls_image.php to static function gd_version().

3 The website background verification code does not display PHP Strict Standards: Redefining already defined constructor for class captcha in D:\web\322\includes\cls_captcha.php on line 119

Open includes/cls_captcha .php

Find the following code

function __construct($folder = '', $width = 145, $height = 20) { $this->captcha($folder, $width, $height); }
Copy after login

and move it above

function captcha($folder = '', $width = 145, $height = 20)
Copy after login

.

The above is the detailed content of What should I do if ecshop reports an error under php5.4?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!