php - How to set command timeout in yii? -
php - How to set command timeout in yii? -
i struggling find set command timeout in yii mysql database (some queries taking while run).
in source code file protected/config/main.php has these settings:
'db'=>array( 'connectionstring' => 'mysql:host=xxx;dbname=xxx;port=xxx;timeout=100;', 'emulateprepare' => true, 'username' => 'xxx', 'password' => 'xxx', 'charset' => 'utf8', 'schemacachingduration'=>3600, ),
the timeout seems apply connections, , command timeout default 30 seconds (that's 1 need increase).
web pages fetching db fail fatal error: maximum execution time of 30 seconds exceeded in \yiiroot\framework\db\cdbcommand.php on line 508.
line 508 is
$this->_statement->execute();
so query timeout.
this not mysql error, php error. fatal error: maximum execution time of 30 seconds
set php.ini setting max_execution_time
default 30. can either alter php.ini file, or can adjust .htaccess or on individual function can utilize set_time_limit()
command.
http://www.php.net//manual/en/function.set-time-limit.php
php mysql yii
Comments
Post a Comment