I am getting this error trying to connect with
Warning: pg_connect() unable to connect to PostgreSQL server: FATAL 1: No
pg_hba.conf entry for host
127.0.0.1, user apache, database tom in /var/www/html/testphp.php on line 3
connection failed!
using
<?php
if (!pg_connect("localhost","5432","tom"))
{echo "connection failed! <br>\n"; exit;}
else
{ echo "connection successful!<br>\n";}
php?>
It is RedHat 8 and apache 2.0.40
Thanks,
Tom