简体   繁体   中英

When apache starts new session a strange error is throwing

Guys I need little bit help with PHP Fatal error. Whenever a new session is getting created a PHP Fatal error occurs. This error never happens throughout the session apart from when session first starts. The error is:

Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement'
is not allowed' in /var/www/downloadanymp3.com/index.php:240
  Stack trace:
    #0 /var/www/downloadanymp3.com/index.php(240): session_commit()
    #1 {main}

Next exception 'Exception' with message 'Serialization of 'SimpleXMLElement'
is not allowed' in /var/www/downloadanymp3.com/index.php:240
  Stack trace:
    #0 /var/www/downloadanymp3.com/index.php(0): session_commit()
    #1 {main}
      thrown in /var/www/downloadanymp3.com/index.php on line 240, referer:
       http://dev.downloadanymp3.com/index.php?searchType=VIDEOTITLE

And one more thing, on index.php the very last line is session_commit();

You're attempting to put a SimpleXML element inside of your session -- Simple XML doesn't allow for serialization like that. If you need to, you can store the XML string in your session, then deserilize that back through SimpleXML if you need it again. Or even better, convert your XML into an array and store that... I personally don't understand why people use XML as a memory storage object anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM