From 944662cba9cd402a3ae5aec89e66dba69d1a3966 Mon Sep 17 00:00:00 2001 From: mafoo Date: Mon, 25 Jan 2016 14:29:27 +0000 Subject: [PATCH] BugFix for remote pgsql databases --- core/install/resources/classes/install_fusionpbx.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/install/resources/classes/install_fusionpbx.php b/core/install/resources/classes/install_fusionpbx.php index c55e89fb9b..1c4ce6d98e 100644 --- a/core/install/resources/classes/install_fusionpbx.php +++ b/core/install/resources/classes/install_fusionpbx.php @@ -173,8 +173,12 @@ include "root.php"; $tmp_config .= "\n"; $tmp_config .= " //pgsql: database connection information\n"; if ($this->global_settings->db_type() == "pgsql") { + $db_host = $this->global_settings->db_host(); $cmt_out = ''; - if($this->global_settings->db_host() != 'localhost') { $cmt_out = "//"; } + if ( $db_host == "localhost" or $db_host == "127.0.0.1") { + //if localhost or 127.0.0.1 we want it to default to a Unix Socket. + $cmt_out = "//"; + } $tmp_config .= " $cmt_out\$db_host = '".$this->global_settings->db_host()."'; //set the host only if the database is not local\n"; $tmp_config .= " \$db_port = '".$this->global_settings->db_port()."';\n"; $tmp_config .= " \$db_name = '".$this->global_settings->db_name()."';\n";