We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Database reconnect


how can I tell, if the DB connection is alive and reconnect if not? (I'm making the daemon app which should run forever but MySQL drop connections after timeout).




I'm new to phalconphp, but you could call connect() on the database adapter in your controller/main loop to make sure the connection "it's alive" . PDO should reuse present connections, so no new connections should be created. Otherwise write an own solution utilizing mysqli_ping .