CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

/var/www/html/common/classs/ClaSite.php(257)

245     }
246 
247     /**
248      * Get domain info
249      * @param type $domain
250      * @return array
251      */
252     public static function getDomainInfo($domain = null) {
253         if (!$domain)
254             $domain = self::getServerName();
255         $domaininfo = Yii::app()->cache->get(self::CACHE_DOMAIN_PRE . $domain);
256         if (!$domaininfo) {
257             $domaininfo = Yii::app()->db->createCommand()->select('*')->from(ClaTable::getTable('domain'))
258                     ->where('domain_id=:domain_id', array(':domain_id' => $domain))
259                     ->queryRow();
260             if ($domaininfo)
261                 Yii::app()->cache->set('domain_' . $domain, $domaininfo);
262         }
263         return $domaininfo;
264     }
265 
266     /**
267      * Get site id from domain
268      * @param type $domain
269      */

Stack Trace

#4
+
 /var/www/html/common/classs/ClaSite.php(257): CModule->__get("db")
252     public static function getDomainInfo($domain = null) {
253         if (!$domain)
254             $domain = self::getServerName();
255         $domaininfo = Yii::app()->cache->get(self::CACHE_DOMAIN_PRE . $domain);
256         if (!$domaininfo) {
257             $domaininfo = Yii::app()->db->createCommand()->select('*')->from(ClaTable::getTable('domain'))
258                     ->where('domain_id=:domain_id', array(':domain_id' => $domain))
259                     ->queryRow();
260             if ($domaininfo)
261                 Yii::app()->cache->set('domain_' . $domain, $domaininfo);
262         }
#5
+
 /var/www/html/common/classs/ClaSite.php(271): ClaSite::getDomainInfo(null)
266     /**
267      * Get site id from domain
268      * @param type $domain
269      */
270     public static function getSiteIdFromDomain($domain = null) {
271         $domaininfo = self::getDomainInfo($domain);
272         if (!$domaininfo)
273             return 0;
274         return $domaininfo['site_id'];
275     }
276 
#6
+
 /var/www/html/common/classs/ClaSite.php(291): ClaSite::getSiteIdFromDomain()
286      * @param type $site_id
287      */
288     public static function getSiteInfo($site_id = 0) {
289         $site_id = (int) $site_id;
290         if (!$site_id)
291             $site_id = self::getSiteIdFromDomain();
292         if ($site_id) {
293             //
294             $translate_language = self::getLanguageTranslate();
295             //
296             //Yii::app()->cache->delete(self::CACHE_SITEINFO_PRE . $site_id . $translate_language);
2021-10-23 12:23:04 Apache/2.4.7 (Ubuntu) Yii Framework/1.1.15