Re: pg_connect() unable to connect to PostgreSQL server :could not connect to server
| From: | Devrim GUNDUZ | Date: | Mon, 22 Jul 2002 07:49:51 +0000 |
| Subject: | Re: pg_connect() unable to connect to PostgreSQL server :could not connect to server | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20700@lists.php.net to get a copy of this message | ||
Hi,
On Mon, 22 Jul 2002, Vincent wrote:
> "Warning: pg_connect() unable to connect to PostgreSQL
> server: could not connect to server: Connection
> refused Is the server running on host localhost and
> accepting TCP/IP connections on port 5432? in
> /usr/local/apache/htdocs/postgresql.php on line 8"
> Unable to connect to database
Please avoid using host=localhost in pg_connect parameters.
As far as I guess, you have not activated the TCP-IP port in
postgresql.conf, and if you use host=localhost parameter, pg_connect will
try to connect to PostgreSQL via TCP-IP. If you do not use that parameter,
then it will connect to the database via Unix domain sockets, which is
really faster than TCP-IP sockets (and more secure).
HTH.
Best regards.
--
Devrim GUNDUZ
devrim@oper.metu.edu.tr
devrim.gunduz@linux.org.tr
Web : http://devrim.oper.metu.edu.tr
-------------------------------------