Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances

1,081 views
Skip to first unread message

ethanpil

unread,
May 20, 2014, 3:05:24 PM5/20/14
to f3-fra...@googlegroups.com
Everything seems to work fine, but F3 keeps spitting out a 500 error: 

PHP Fatal error:  Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in /home/.../lib/f3/base.php:1571\nStaF3 keeck trace:\n#0 [internal function]: PDO->__sleep()\n#1 /home.../f3/base.php(1571): session_commit()\n#2 [internal function]: Base->unload('/home/...')\n#3 {main}\n  thrown in /home/.../f3/base.php on line 1571

ikkez

unread,
May 20, 2014, 4:50:19 PM5/20/14
to f3-fra...@googlegroups.com
do you serialize / json encode any hive or error trace somewhere? it could be that the DB object (PDO) is included there, but by the nature of PDO, it can't be serialized, which might cause this error.

matt smith

unread,
May 21, 2014, 12:35:06 PM5/21/14
to f3-fra...@googlegroups.com
I dont know if this is the same thing, but I was getting that instead of showing the actual original error do to a change in base.php. Around line 1018 in base.php, change...
'trace'=>unserialize(serialize($trace))
...to...
'trace'=>$trace
...then see if you get a 'proper' error message.

ethanpil

unread,
May 25, 2014, 10:14:43 PM5/25/14
to f3-fra...@googlegroups.com
Yes, I found it.. It seems that I  placed a Mapper object in the SESSION.... 
Reply all
Reply to author
Forward
0 new messages