CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Resource temporarily unavailable

/mnt/phplibs/yii/db/CDbConnection.php(382)

370                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
371             try
372             {
373                 Yii::trace('Opening DB connection','system.db.CDbConnection');
374                 $this->_pdo=$this->createPdoInstance();
375                 $this->initConnection($this->_pdo);
376                 $this->_active=true;
377             }
378             catch(PDOException $e)
379             {
380                 if(YII_DEBUG)
381                 {
382                     throw new CDbException('CDbConnection failed to open the DB connection: '.
383                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
384                 }
385                 else
386                 {
387                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
388                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
389                 }
390             }
391         }
392     }
393 
394     /**

Stack Trace

#7
+
 /www/hkcompanysearch.com/protected/models/Company.php(7): CActiveRecord->findByPk("1130945")
02 class Company extends CActiveRecord
03 {
04 
05     public static function get($id)
06     {
07         $model = self::model()->findByPk($id);
08         return $model;
09     }
10 
11 
12     public static function get_relate_hkcom($kw, $num=10)/*{{{*/
#8
+
 /www/hkcompanysearch.com/protected/controllers/DefaultController.php(196): Company::get("1130945")
191         $company_id=Helper::replace_keyword($key,2);
192         if(is_numeric($company_id) == false){
193             throw new CHttpException(404, '参数错误');
194         }
195 
196         $company = Company::get($company_id);
197         if(!$company){
198             throw new CHttpException(404, '找不到企业信息');
199         }
200 
201         $this->pageTitle = $company->enname;
#16
+
 /www/hkcompanysearch.com/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-28 11:58:46 nginx/1.10.0 Yii Framework/1.1.14