Notice: unserialize() [function.unserialize]: Error at offse

2016-07-07 15:14 来源:www.chinab4c.com 作者:ecshop专家

报错信息:
Notice: unserialize() [function.unserialize]: Error at offset 159 of 647 bytes in \eshop\includes\lib_common.php on line 224

lib_common.php的224行
  1. $cfg = unserialize($GLOBALS['_CFG']['integrate_config']);
复制代码


是将会员整合配置信息反序列化的操作,产生报错的原因是因为序列化的字符串格式不对,无法正常反序列化,产生这种情况的时候很少,目前只在UTF-8编码格式下发现。

解决方法,在lib_common.php大约604行找到
  1. if (empty($arr['integrate_code']))
  2. {
  3. $arr['integrate_code'] = 'ecshop'; // 默认的会员整合插件为 ecshop
  4. }
  5. write_static_cache('shop_config', $arr);
复制代码


修改为
  1. if (empty($arr['integrate_code']))
  2. {
  3. $arr['integrate_code'] = 'ecshop'; // 默认的会员整合插件为 ecshop
  4. }
  5. if (!empty($arr['integrate_config']) && EC_CHARSET == 'utf-8')
  6. {
  7. $arr['integrate_config'] = preg_replace('!s:(\d+):"(.*?)";!se',"'s:'.strlen('$2').':\"$2\";'",str_replace(' ','',$arr['integrate_config']));
  8. }
  9. write_static_cache('shop_config', $arr);
复制代码


修改完成后,进入后台清除缓存。

注意:这个只能用在lib_common.php 224行的这个错误上,如果不是请不要随便修改程序。如果在使用中遇到问题可通过站内信与我联系。

回答:
支持~~

广告位出租 (开个玩笑)

提倡分享!支持一下。

多谢了

學習
辛苦了

Notice: unserialize() [function.unserialize]: Error at offset 1385 of 10575 bytes in D:\www\www.hlfcs.com\includes\lib_common.php on line 224

我整合后商城首页是这样的错误,用楼上的方式没起作用啊!求救!!!

没用啊,改了还是一样,楼主能补能给个解释

楼上的错误怎么修改的?我也出现了同样的错误,按楼主的方法改了还是没用的

我的也是不行。。。。

我也遇到过这种情况

恢复之前的数据就可以了

恢复一下之前备份的数据!

Notice: unserialize() [function.unserialize]: Error at offset 48 of 69 bytes in /www/users/taocha51.com/includes/cls_session.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/init.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/init.php on line 163

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/cls_template.php on line 58

我时不时会出现这样的问题。。。是怎么回事啊。。又不是次次都会出现,只是偶尔出现以下,有解决办法吗

Notice: unserialize() [function.unserialize]: Error at offset 48 of 69 bytes in /www/users/taocha51.com/includes/cls_session.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/init.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/init.php on line 163

Warning: Cannot modify header information - headers already sent by (output started at /www/users/taocha51.com/includes/cls_session.php:162) in /www/users/taocha51.com/includes/cls_template.php on line 58
我的是时不时出现这样的代码,需要怎么解决吗?求解