Magento遇到Serialization is not allowed

It is quite famous error.

It means that somewhere you save object of SimpleXMLElement class (or its child) to the session. In your particular case it is Mage_Core_Model_Config_Element class.

When script ends his work, php tries to save all objects from $_SESSION array to the session file and tries to serialize $_SESSION array. Unfortunately, SimpleXMLElement can't be serialized because it wraps a libxml resource type. Resources cannot be serialized in php.

Probably, you are doing somewhere something like Mage::getSingleton('core/session')->setXXX(Mage::getConfig()->getNode('...'))Mage_Core_Model_Config::getNode() returns Mage_Core_Model_Config_Element, not just string.

So, you need to find this place and either add (string) type cast or use Mage::getStoreConfig('...').


综上,找到问题所在,在session里面保存了一个SimpleXMLElement配置相关的项,该项里面包含了一个libxml资源类型值,而PHP不允许资源序列化,因此抛出异常。


转载于:https://my.oschina.net/lxrm/blog/412787

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值