Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 118 in file classes/db/DbPDO.php
113. public function connect()
114. {
115. try {
116. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
117. } catch (PDOException $e) {
118. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
119. }
120.
121. $this->link->exec('SET SESSION sql_mode = \'\'');
122.
123. return $this->link;
326. if (!defined('_PS_DEBUG_SQL_')) {
327. define('_PS_DEBUG_SQL_', false);
328. }
329.
330. if ($connect) {
331. $this->connect();
332. }
333. }
334.
335. /**
336. * Disable the use of the cache.
236. $class = Db::getClass();
237. self::$instance[$id_server] = new $class(
238. self::$_servers[$id_server]['server'],
239. self::$_servers[$id_server]['user'],
240. self::$_servers[$id_server]['password'],
241. self::$_servers[$id_server]['database']
242. );
243. }
244.
245. return self::$instance[$id_server];
246. }
42. * @param bool $htmlOK Does data contain HTML code ? (optional)
43. * @return string Sanitized data
44. */
45. function pSQL($string, $htmlOK = false)
46. {
47. return Db::getInstance()->escape($string, $htmlOK);
48. }
49.
50. function bqSQL($string)
51. {
52. return str_replace('`', '\`', pSQL($string));
1346. private static function findShopByHost($host)
1347. {
1348. $sql = 'SELECT s.id_shop, CONCAT(su.physical_uri, su.virtual_uri) AS uri, su.domain, su.main
1349. FROM ' . _DB_PREFIX_ . 'shop_url su
1350. LEFT JOIN ' . _DB_PREFIX_ . 'shop s ON (s.id_shop = su.id_shop)
1351. WHERE (su.domain = \'' . pSQL($host) . '\' OR su.domain_ssl = \'' . pSQL($host) . '\')
1352. AND s.active = 1
1353. AND s.deleted = 0
1354. ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC';
1355.
1356. $result = Db::getInstance()->executeS($sql);
346. $found_uri = '';
347. $is_main_uri = false;
348. $host = Tools::getHttpHost(false, false, true);
349. $request_uri = rawurldecode($_SERVER['REQUEST_URI']);
350.
351. $result = self::findShopByHost($host);
352.
353. // If could not find a matching, try with port
354. if (empty($result)) {
355. $host = Tools::getHttpHost(false, false, false);
356. $result = self::findShopByHost($host);
112.
113. $context = Context::getContext();
114.
115. /* Initialize the current Shop */
116. try {
117. $context->shop = Shop::initialize();
118. } catch (PrestaShopException $e) {
119. $e->displayMessage();
120. }
121. define('_THEME_NAME_', $context->shop->theme->getName());
122. define('_PARENT_THEME_NAME_', $context->shop->theme->get('parent') ?: '');
22. * @author PrestaShop SA and Contributors <[email protected]> 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/777583.cloudwaysapps.com/jfnuunzhhb/public_html/config/config.inc.php