1 - 下载 Swoole Loader 请下载 WINNT 系统 PHP-7.4.33 版本 非线程安全 的 swoole_loader 扩展,点击直达下载页面 2 - 安装 Swoole Loader 将刚才下载的 swoole_loader 扩展文件( swoole_loader.dll )上传到当前 PHP 的扩展安装目录中: ext......
ecshop在php5.4版的错误代码修改
ecshop在php5.3版以上的环境下会出现很多错误,这里介绍一下怎么修改。
工具/原料
- ecshop
方法/步骤
安装的时候出现错误
Non-static method cls_image::gd_version() should not be called statically in includes\lib_installer.php on line 31
进入install/include目录打开文件 找到31行
return cls_image::gd_version();
修改成
$p = new cls_image();
return $p->gd_version();
还有根目录的include目录下的lib_base.php的346行也是一样修改
安装完登录后台提示:
Only variables should be passed by reference includes\cls_template.php on line 406
打开includes\cls_template.php 找到406行
$tag_sel = array_shift(explode(' ', $tag));改成:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
出现Redefining already defined constructor for class alipay 错误,页面比较多,
把构造函数__construct移到同名函数前面
如:include/cls_captcha.php
把
function __construct($folder = '', $width = 145, $height = 20)
{
$this->captcha($folder, $width, $height);
}
移到
function captcha($folder = '', $width = 145, $height = 20)
前面
需要注意的是后台支付方式里的大多数都要做这个修改
打开前台页出现:
Only variables should be passed by referenceincludes\lib_main.php on line 1329
$ext=end(explode('.',$tmp));
修改为:
$ext=explode('.',$tmp);$ext=end($ext);
打开后台出现:
XmlHttpRequest status:[500] Unknow status
找到/admin/templates/top.htm
然后删除下面的代码:
script type="text/javascript">
onload = function()
{
Ajax.call('index.php?is_ajax=1&act=license','', start_sendmail_Response, 'GET', 'JSON');
}
/**
* 帮助系统调用
*/
function web_address()
{
var ne_add = parent.document.getElementById('main-frame');
var ne_list = ne_add.contentWindow.document.getElementById('search_id').innerHTML;
ne_list.replace('-', '');
var arr = ne_list.split('-');
window.open('help.php?al=' arr[arr.length - 1],'_blank');
}
/**
* 授权检测回调处理
*/
function start_sendmail_Response(result)
{
// 运行正常
if (result.error == 0)
{
var str = '';
if (result['content']['auth_str'])
{
str = 'a href="javascript:void(0);" target="_blank">' result['content']['auth_str'];
if (result['content']['auth_type'])
{
str = '[' result['content']['auth_type'] ']';
}
str = '/a> ';
}
document.getElementById('license-div').innerHTML = str;
}
}
function modalDialog(url, name, width, height)
{
if (width == undefined)
{
width = 400;
}
if (height == undefined)
{
height = 300;
}
if (window.showModalDialog)
{
window.showModalDialog(url, name, 'dialogWidth=' (width) 'px; dialogHeight=' (height 5) 'px; status=off');
}
else
{
x = (window.screen.width - width) / 2;
y = (window.screen.height - height) / 2;
window.open(url, name, 'height=' height ', width=' width ', left=' x ', top=' y ', toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, modal=yes');
}
}
function ShowToDoList()
{
try
{
var mainFrame = window.top.frames['main-frame'];
mainFrame.window.showTodoList(adminId);
}
catch (ex)
{
}
}
{/literal}
var adminId = "{$admin_id}";
/script>
找到/admin/templates/menu.htm
419行删除
Ajax.call('cloud.php?is_ajax=1&act=menu_api','', start_menu_api, 'GET', 'JSON');
找到/admin/templates/start.htm
9行删除
Ajax.call('cloud.php?is_ajax=1&act=cloud_remind','', cloud_api, 'GET', 'JSON');
24行删除
Ajax.call('cloud.php?is_ajax=1&act=close_remind&remind_id=' id,'', cloud_api, 'GET', 'JSON');
后台商店设置出现
You should be using the time() function instead in admin\sms_url.php on line 31
admin\shop_config.php on line 32
mktime()修改为 time()
商品批量上传出现
Assigning the return value of new by reference is deprecated in admin\goods_batch.php on line 921
$filter = &new stdclass;
改成
$filter = new stdclass;
会员整合出现
phpbb::set_cookie() should be compatible with integrate
\includes\modules\integrates\phpbb.php on line 232
110行
function set_cookie ($username="")
修改成
function set_cookie ($username="", $remember = NULL)
includes\modules\integrates\phpwind6.php
ucenter.php vbb.php也是这样修改
ucenter.php 210行修改成
function add_user($username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, $md5password = '')
127行修改成
function login($username, $password, $remember = NULL)
数据库备份出现
edefining already defined constructor for class cls_sql_dump
\admin\includes\cls_sql_dump.php on line 90
function __construct(&$db, $max_size =0)
{
$this->cls_sql_dump($db, $max_size);
}
移到function cls_sql_dump(&$db, $max_size=0)前面
Non-static method cls_sql_dump::get_random_name()admin\database.php on line 64
打开includes\cls_sql_dump.php
479行
function get_random_name()
修改成
static function get_random_name()
注意事项
- 其他错误再慢慢增加
以上方法由办公区教程网编辑摘抄自百度经验可供大家参考!
标签: PHP
相关文章