php - Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] timeout expired -


i error message when try connect postgresql via php on windows

warning: uncaught exception 'pdoexception' message 'sqlstate[08006] [7] timeout expired' in c:\apache24\htdocs\projetbdd\reconcept.php:2 stack trace: #0 c:\apache24\htdocs\projetbdd\reconcept.php(2): pdo->__construct('pgsql:host=loca...', 'postgres', 'momocrosse') #1 {main} thrown in c:\apache24\htdocs\projetbdd\reconcept.php on line 2  fatal error: maximum execution time of 30 seconds exceeded in c:\apache24\htdocs\projetbdd\reconcept.php on line 2 

you can specifies timeout duration of connection use:

$connection->setattribute(pdo::attr_timeout, 15); 

form more details see page: http://php.net/manual/en/pdo.setattribute.php


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -