Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 136 in file classes/db/DbPDO.php
131. public function connect()
132. {
133. try {
134. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
135. } catch (PDOException $e) {
136. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
137. }
138.
139. $this->link->exec('SET SESSION sql_mode = \'\'');
140.
141. return $this->link;
374. }
375.
376. $this->result = $this->_query($sql);
377.
378. if (!$this->result && $this->getNumberError() == 2006) {
379. if ($this->connect()) {
380. $this->result = $this->_query($sql);
381. }
382. }
383.
384. if (_PS_DEBUG_SQL_) {
608. }
609.
610. return $this->execute($sql, $use_cache);
611. }
612.
613. $this->result = $this->query($sql);
614.
615. if (!$this->result) {
616. $result = false;
617. } else {
618. if (!$array) {
Argument [0]
SELECT c.`name`, cl.`id_lang`, IF(cl.`id_lang` IS NULL, c.`value`, cl.`value`) AS value, c.id_shop_group, c.id_shop
FROM `snsps_configuration` c
LEFT JOIN `snsps_configuration_lang` cl ON (c.`id_configuration` = cl.`id_configuration`)
155. FROM `' . _DB_PREFIX_ . bqSQL(self::$definition['table']) . '` c
156. LEFT JOIN `' . _DB_PREFIX_ . bqSQL(self::$definition['table']) . '_lang` cl ON (c.`' . bqSQL(
157. self::$definition['primary']
158. ) . '` = cl.`' . bqSQL(self::$definition['primary']) . '`)';
159. $db = Db::getInstance();
160. $results = $db->executeS($sql);
161. if ($results) {
162. foreach ($results as $row) {
163. $lang = ($row['id_lang']) ? $row['id_lang'] : 0;
164. self::$types[$row['name']] = (bool) $lang;
165.
Argument [0]
SELECT c.`name`, cl.`id_lang`, IF(cl.`id_lang` IS NULL, c.`value`, cl.`value`) AS value, c.id_shop_group, c.id_shop
FROM `snsps_configuration` c
LEFT JOIN `snsps_configuration_lang` cl ON (c.`id_configuration` = cl.`id_configuration`)
204. return false;
205. }
206.
207. // Init the cache on demand
208. if (!self::$_initialized) {
209. Configuration::loadConfiguration();
210. }
211. $idLang = (int) $idLang;
212.
213. if (!self::isLangKey($key)) {
214. $idLang = 0;
284. public static function getMultiShopValues($key, $idLang = null)
285. {
286. $shops = Shop::getShops(false, null, true);
287. $resultsArray = [];
288. foreach ($shops as $idShop) {
289. $resultsArray[$idShop] = Configuration::get($key, $idLang, null, $idShop);
290. }
291.
292. return $resultsArray;
293. }
294.
Argument [0] PS_MEDIA_SERVER_1 Argument [1] Argument [2] Argument [3] 1
375. }
376. }
377.
378. $http_host = Tools::getHttpHost();
379. $all_media = array_merge(
380. Configuration::getMultiShopValues('PS_MEDIA_SERVER_1'),
381. Configuration::getMultiShopValues('PS_MEDIA_SERVER_2'),
382. Configuration::getMultiShopValues('PS_MEDIA_SERVER_3')
383. );
384.
385. if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI() || in_array($http_host, $all_media)) {
Argument [0] PS_MEDIA_SERVER_1
113.
114. $context = Context::getContext();
115.
116. /* Initialize the current Shop */
117. try {
118. $context->shop = Shop::initialize();
119. } catch (PrestaShopException $e) {
120. $e->displayMessage();
121. }
122. define('_THEME_NAME_', $context->shop->theme->getName());
123. define('_PARENT_THEME_NAME_', $context->shop->theme->get('parent') ?: '');
22. * @author PrestaShop SA and Contributors <contact@prestashop.com>
23. * @copyright Since 2007 PrestaShop SA and Contributors
24. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
25. */
26.
27. require dirname(__FILE__).'/config/config.inc.php';
28. Dispatcher::getInstance()->dispatch();
Argument [0] /home/andoni/public_html/config/config.inc.php