ECShop 2.7.3版支持的 PHP 版本为 PHP5.2
为了让ECShop 2.7.3版支持的 PHP7 需要做以下修改
问题 1:安装第一步
http://ecshop.io/install/index.php
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ECS has a deprecated constructor in /Users/s/workspaces/phproot/ecshop/includes/cls_ecshop.php on line 25
- 修改文件 /includes/cls_ecshop.php 38行
function ECS($db_name, $prefix)
{
$this->db_name = $db_name;
$this->prefix = $prefix;
}
//修改为
function __construct($db_name, $prefix)
{
$this->db_name = $db_name;
$this->prefix = $prefix;
}
问题 2:安装第二步
http://ecshop.io/install/index.php?lang=zh_cn&step=check
Deprecated: Non-static method cls_image::gd_version() should not be called statically in /Users/s/workspaces/phproot/ecshop/install/includes/lib_installer.php on line 31
- 修改文件 /includes/cls_image.php 38行
function gd_version()
//修改为
static function gd_version()
问题 3:安装第二步
http://ecshop.io/install/index.php?lang=zh_cn&step=check
是否支持 JPEG……………………………………………………………………..不支持
修改文件 /includes/cls_installer.php 97行
$jpeg_enabled = ($gd_info['JPG Support'] === true) ? $_LANG['support'] : $_LANG['not_support'];
修改为
$jpeg_enabled = ($gd_info['JPEG Support'] === true) ? $_LANG['support'] : $_LANG['not_support'];
问题 4:PHP7 不再支持 mysql 扩展,只能使用 mysqli 或者 pdo
……