首页 > 其他 > 详细

Magento遇到Serialization is not allowed

时间:2015-05-09 20:37:57      阅读:383      评论:0      收藏:0      [点我收藏+]

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不允许资源序列化,因此抛出异常。


Magento遇到Serialization is not allowed

原文:http://my.oschina.net/lxrm/blog/412787

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!