unable to connect to postgres from php
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 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
_________________
|