X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=install.php;h=901e502f1a2e45ca347db2292dd41006634e848d;hb=5caa90c6e73655574aa6846fb4b2552d06f67118;hp=1d3a531c5ac8c5ef984c3e71b26b1df85efbd8a1;hpb=22466530eff42fa6b1e1ea2380227ad5f4b22923;p=quix0rs-gnu-social.git diff --git a/install.php b/install.php index 1d3a531c5a..901e502f1a 100644 --- a/install.php +++ b/install.php @@ -242,6 +242,20 @@ 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')); + if ($record->server_encoding != 'UTF8') { + updateStatus("Laconica requires UTF8 character encoding. Your database is ". htmlentities($record->server_encoding)); + showForm(); + return false; + } updateStatus("Running database script..."); //wrap in transaction;