Re: [Postfixadmin-devel] database connection (not using std. port
Brought to you by:
christian_boltz,
gingerdog
From: David G. <da...@co...> - 2009-04-28 08:48:33
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bird wrote: > Message body follows: > > Hi, > > I do NOT use the standard port 55xx for postgresql. > > How can I add the selected port in confic.inc.php ? > $CONF['port'] = 'xxxxx' > > this did not work: > $CONF['database_port'] = 'xxxxx'; > > I use NOT the standard port for postgresql because > I do not want to reveal the type of database > with a portscan by nmap for an application. > > Thank you ! Hi, See functions.inc.php - there is a function called 'db_connect()' which contains something like : elseif ($CONF['database_type'] == "pgsql") { if (function_exists ("pg_pconnect")) { $connect_string = "host=" . $CONF['database_host'] . " dbname=" . $CONF['database_name'] . " user=" . $CONF['database_user'] . " password=" . $CONF['database_password']; $link = @pg_pconnect ($connect_string) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: failed to connect to database. $DEBUG_TEXT"); if ($link) pg_set_client_encoding($link, 'UNICODE'); } else { $error_text .= "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; } } http://php.net/pg_connect which will show you how you can change the pg_pconnect line. (I suspect you just need "port=1234 " in the $connect_string somewhere. thanks David. - -- David Goodwin [ david at codepoets dot co dot uk ] [ http://www.codepoets.co.uk ] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkn2wwYACgkQ/ISo3RF5V6aIFgCg8Hnm3+7phBlRoWi2dPz52heR TQAAniciUIBZapRGcDoV3cZb+GY5EApk =NJ3n -----END PGP SIGNATURE----- |