You Cannot Serialize Or Unserialize Pdo Instances Php
Posted By admin On 04/05/18PHPUnit and PDOException + Solution Nov 1. I recently needed to. PDOException: You cannot serialize or unserialize PDO instances.
Yes I did, but I do not see the relevance between this particular problem and cookies, because every time I try to clear cache using php app/console cache:clear command, the same error occurs. This procedure was valid for Symfony 2.5, at 2.6 they made change which allows for passing dsn as parameter in pdo session handler, and for some reason when I try to pass the PDO class to the handler, it tries to serialize and pass the instance, so I think the problem lies there. It would be best if you can come up with a solution which will allow us to use the recommended way as stated by Symfony to pass dsn as parameter to the handler, and still make the websocketbundle work. Parameters: pdo.db_options: db_table: sessions lock_mode: 0 services: pdo: class: PDO arguments: dsn: mysql:host=%database_host%;port=%database_port%;dbname=%database_name% user:%database_user% password:%database_password% calls: - [ setAttribute, [3, 2] ] # PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION session.handler.pdo: class: Symfony Component HttpFoundation Session Storage Handler PdoSessionHandler arguments: [@pdo,%pdo.db_options%] Which version of Symfony are you using? Chad 2000 Refrigerator Software Informer. By removing public: false on session handler it work? Gos_web_socket: client: session_handler: @session.handler.pdo firewall: main # Example: secured_area, you must replace it by your firewall shared_config: true assetic: true #use assetic bundle server: host: '%websocket_host% ' #The host ip to bind to port: '%websocket_port% ' #The port the socket server will listen on router: resources: - @AppBundle/Resources/config/pubsub/routing.yml pushers: wamp: host: '%websocket_host% ' port: '%websocket_port% ' The problem is unfortunately still showing.