标签:
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