Solution for ECSHOP errors in PHP5.5 and later versions: ecshopphp5.5
Ecshop has not been modified yet. If the ecshop program is installed on the php Virtual Host of the High Version, compatibility issues may occur.
The following two error messages are prompted when you install php5.5 in the local environment.:
Only variables shocould be passed by reference php
Deprecated: preg_replace (): The/e modifier is deprecated, use preg_replace_callback instead ...?
Through searching on the network, Xiao Bian found that it was not only installed in a lower version of php, but also found a solution for you to debug the program in php5.5. Here we will share the solution:
First, describe the solution to the first problem:
Php version 5.3 or later is related to configuration. if you split this sentence into two sentences in line 418, there is no problem.
Set the following:
$tag_sel = array_shift(explode(' ', $tag));
To:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
Because the array_shift parameter is passed by reference, by default, more than 5.3 can only pass specific variables, but cannot return values through the function.
Solution to the second error:
Find the file:Include/cls_template.php
Run the following code:
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
Modify:
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);
At present, xiaobian only encounters these two errors. If other problems are encountered during program debugging and development, if they can be solved, xiaobian will also work out the solution.
Solution to ecshop errors in PHP of High Version
1. When ecshop prompts Strict Standards: Non-static method cls_image
::gd_version() should not be called statically inE:/wwwroot/weirenchou/includes/lib_base.php on line 346
Find row 346.
return cls_image::gd_version()
Replace:
$p = new cls_image();return $p->gd_version();
2. the following error occurs during ecshop:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /ecshop/includes/cls_template.php on line 300
Open the ecshop directory and find lines 3 to 300th, which contain "des/cls_template.php ".
Set
return preg_replace("/{([^/}/{/n]*)}/e", "/$this->select('//1');", $source);
Replace
return preg_replace_callback("/{([^/}/{/n]*)}/", function($r) { return $this->select($r[1]); }, $source);
3. Strict Standards: Only variables shocould be passed by reference in E:/web/shopex/nodes des/cls_template.php on line 422
$tag_sel = array_shift(explode(' ', $tag));
Changed:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
4. Member Integration
Phpbb: set_cookie () shocould be compatible with integrate/Des/modules/integrates/phpbb. php on line 232110 row function set_cookie ($ username = "")
Modify
function set_cookie ($username="", $remember = NULL)includes/modules/integrates/phpwind6.php
The same is true for ucenter. php vbb. php.
Modify ucenter. php line 210
function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '')
Change row 127
function login($username, $password, $remember = NULL)
5. Database Backup appears
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); }
Move to function cls_ SQL _dump (& $ db, $ max_size = 0)
Non-static method cls_sql_dump::get_random_name() admin/database.php on line 64
Open mongodes/cls_ SQL _dump.php
479 rows
function get_random_name()
Modify
static function get_random_name()