Link to database cannot be established: SQLSTATE[HY000] [2002] Connection refused
at line 119 in file classes/db/DbPDO.php
114. public function connect()
115. {
116. try {
117. $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5);
118. } catch (PDOException $e) {
119. throw new PrestaShopException('Link to database cannot be established: ' . $e->getMessage());
120. }
121.
122. $this->link->exec('SET SESSION sql_mode = \'\'');
123.
124. return $this->link;
375. }
376.
377. $this->result = $this->_query($sql);
378.
379. if (!$this->result && $this->getNumberError() == 2006) {
380. $this->connect();
381. $this->result = $this->_query($sql);
382. }
383.
384. if (_PS_DEBUG_SQL_) {
385. $this->displayError($sql);
605. // This method must be used only with queries which display results
606. if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)) {
607. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
608. }
609.
610. $this->result = $this->query($sql);
611.
612. if (!$this->result) {
613. $result = false;
614. } else {
615. if (!$array) {
Argument [0] SELECT a.`id_lgcookieslaw_purpose`, a.`locked_modules` FROM `ps_4ftPiMT1_lgcookieslaw_purpose` a WHERE (a.`id_shop` = 1) AND (a.`active` = 1)
406.
407. if ($active) {
408. $query->where('a.`active` = ' . (int) $active);
409. }
410.
411. return Db::getInstance()->executeS($query);
412. }
413.
414. public function deleteAssociatedCookies()
415. {
416. $lgcookieslaw_cookies = LGCookiesLawCookie::getCookiesByPurpose((int) $this->id, null, (int) $this->id_shop);
Argument [0] SELECT a.`id_lgcookieslaw_purpose`, a.`locked_modules` FROM `ps_4ftPiMT1_lgcookieslaw_purpose` a WHERE (a.`id_shop` = 1) AND (a.`active` = 1)
5607.
5608. $lgcookieslaw_accepted_purposes = !empty($lgcookieslaw_cookie_values->lgcookieslaw_accepted_purposes) ?
5609. implode(',', $lgcookieslaw_cookie_values->lgcookieslaw_accepted_purposes) : null;
5610.
5611. $lgcookieslaw_purposes_locked_modules =
5612. LGCookiesLawPurpose::getLockedModules($lgcookieslaw_accepted_purposes);
5613.
5614. $lgcookieslaw_all_locked_modules = [];
5615.
5616. if (!empty($lgcookieslaw_purposes_locked_modules)) {
5617. foreach ($lgcookieslaw_purposes_locked_modules as $lgcookieslaw_purpose_locked_modules) {
Argument [0]
15. if (!empty($modules_to_invoke)
16. && Module::isInstalled('lgcookieslaw')
17. && Module::isEnabled('lgcookieslaw')
18. ) {
19. $lgcookieslaw = Module::getInstanceByName('lgcookieslaw');
20. $modules_to_invoke = $lgcookieslaw->getHookModuleExecList($modules_to_invoke);
21. }
22. return $modules_to_invoke;
23. }
24. }
Argument [0]
Array
(
[0] => Array
(
[id_hook] => 892
[module] => blockreassurance
[id_module] => 2
)
[1] => Array
(
[id_hook] => 892
[module] => ps_socialfollow
[id_module] => 20
)
[2] => Array
(
[id_hook] => 892
[module] => klaviyopsautomation
[id_module] => 41
)
[3] => Array
(
[id_hook] => 892
[module] => ps_facebook
[id_module] => 44
)
[4] => Array
(
[id_hook] => 892
[module] => ps_emailalerts
[id_module] => 60
)
[5] => Array
(
[id_hook] => 892
[module] => ps_emailsubscription
[id_module] => 94
)
)
798. throw new PrestaShopException('Invalid id_module or hook_name');
799. }
800.
801. // If no modules associated to hook_name or recompatible hook name, we stop the function
802.
803. if (!$module_list = Hook::getHookModuleExecList($hook_name)) {
804. if ($isRegistryEnabled) {
805. $hookRegistry->collect();
806. }
807.
808. return ($array_return) ? [] : '';
Argument [0] actionFrontControllerSetMedia
943. $this->registerJavascript($js['id'], $js['path'], $js);
944. }
945. }
946.
947. // Execute Hook FrontController SetMedia
948. Hook::exec('actionFrontControllerSetMedia', []);
949.
950. return true;
951. }
952.
953. /**
Argument [0] actionFrontControllerSetMedia Argument [1] Array ( )
299. {
300. $this->init();
301. if ($this->checkAccess()) {
302. // setMedia MUST be called before postProcess
303. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
304. $this->setMedia();
305. }
306.
307. // postProcess handles ajaxProcess
308. $this->postProcess();
309.
505.
506. // Execute hook dispatcher
507. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
508.
509. // Running controller
510. $controller->run();
511.
512. // Execute hook dispatcher after
513. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher);
514. } catch (PrestaShopException $e) {
515. $e->displayMessage();
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();