From: Craig Andrews Date: Sat, 25 Jul 2009 04:19:12 +0000 (-0400) Subject: If cannot connect, then stop the installation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f86faaf341ee6e6e8cfd264e1d645cc0d964d85b;p=quix0rs-gnu-social.git If cannot connect, then stop the installation --- diff --git a/install.php b/install.php index d5e8e8b61f..901e502f1a 100644 --- a/install.php +++ b/install.php @@ -242,6 +242,12 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename) { updateStatus("Starting installation..."); updateStatus("Checking database..."); $conn = pg_connect($connstring); + + if ($conn ===false) { + updateStatus("Failed to connect to database: $connstring"); + showForm(); + return false; + } //ensure database encoding is UTF8 $record = pg_fetch_object(pg_query($conn, 'SHOW server_encoding'));