|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1377 Can't connect to database
Submitted: 1999-05-05 13:01 UTC Modified: 1999-05-05 13:11 UTC
From: dinh at td dot es dot hac dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 3.0.7 OS: Linux 2.0.36
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dinh at td dot es dot hac dot com
New email:
PHP Version: OS:


 [1999-05-05 13:01 UTC] dinh at td dot es dot hac dot com
$db=pg_Connect('localhost', 5432,  "", "", 'twig');
if (! $db) {
  PrintError("Could not connect to database");
  return 0;

./configure --with-pgsql=/usr/local/pgsql  \
        --with-apache=/u/dinh/apache_1.3.6 \
        --enable-track-vars --with-imap=/u/dinh/imap-4.5 \
        --with-gd=/u/dinh/gd_1.3 --with-x --with-zlib \

I am able to connect to the Postgres database by running
   pgsql twig

When running the above php3 code by opening the URL, I received the following
error message:
  Warning: Unable to connect to PostgresSQL server: connectDB()
  failed: Is   the postmaster running and accepting TCP/IP(with -i)
  connections at  'localhost' on port '5432'? in features/
  on line 35
  Error: Could not connect to database Failed!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-05 13:11 UTC] sas at cvs dot php dot net
You are probably running into the problem which is outlined on

Starting the postmaster with -i should help. If you want to connect through the faster Unix socket instead of the TCP socket, replace "localhost" with "" and 5432 with "".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 16:03:36 2021 UTC