Home > Article > Backend Development > What should I do if ecshop reports an error under php5.4?
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.
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));
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));
Change to:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
( 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); }
and move it above
function captcha($folder = '', $width = 145, $height = 20)
.
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!