Results 1 to 2 of 2
i have written a small php code. when i try to access it on webpage, its not showing. <?php $dbconn = pg_connect("host=localhost port=5432 dbname=martha"); echo pg_dbname(); ?> the log file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-04-2005 #1
- Join Date
- Mar 2005
not able to connect to postgres
$dbconn = pg_connect("host=localhost port=5432 dbname=martha");
the log file message is ::
[client 192.168.1.13] PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: \xec0\xd2\n\tIs the server running on host "localhost" and accepting\n\tTCP/IP connections on port 5432?\n. in /var/www/html/sample1.php on line 5
[client 192.168.1.13] PHP Warning: pg_dbname(): No PostgreSQL link opened yet. in /var/www/html/sample1.php on line 7
- 07-04-2005 #2
- Join Date
- Oct 2001
- Täby, Sweden
I moved this to the programming forum instead.
Anyhow, are you sure that the PG server is running at all? What happens if you try to connect to it with telnet, as follows (and that's a shell command, not PHP code)?
telnet localhost 5432