Jump to content

Recommended Posts

Posted

I was trying to figure this out on my own by reading various posts and I'm not sure if the problem is on my side or not. I recently created a Postgresql database and now I'd like to access it through a PHP script from my heliohost web site.

The pg_connect call in my PHP script looks like
 
$result=pg_connect("host=ricky.heliohost.org port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****");


I'm getting this response

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "64.62.211.134", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/

psql.php on line 11

I've seen some posts indicating remote access is disabled by default and we have to ask your support team to enable it.

 

My info
Database:  daskunk_DaSkunkWorksPBC
User:      daskunk_php
Domain:    daskunk.heliohost.org
Server:    ricky

Any help in resolving this is greatly appreciated. Thank you in advance.

Posted (edited)

I tried both

$connessione=pg_connect("host=localhost dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=<removed>") or die("Database non disponibile");

which resulted in

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/psql.php on line 12

 

and

$connessione=pg_connect("host=localhost.heliohost.org dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=<removed>") or die("Database non disponibile");

which resulted in

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not translate host name "localhost.heliohost.org" to address: Name or service not known in /home/daskunk/public_html/pbc/psql.php on line 12

 

So if neither is correct syntax, can someone please help with the correct syntax.  Otherwise is one of them is correct usage of localhost, then that is not working either.

 

I would really like to get my postgresql db working from my web site.

 

Thank you

Edited by Krydos
removed password
Posted

The second one will never work because localhost.heliohost.org doesn't exist, and if it did it would be a user's account.

 

Does the first one work now?

Posted

Reverted back to the first one and tried again.

$dbconn=pg_connect("host=localhost port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****")

 

 

Still getting this error

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "daskunk_php", database "daskunk_DaSkunkWorksPBC", SSL off in /home/daskunk/public_html/pbc/psql.php on line 12

Posted

$dbconn=pg_connect("host=localhost port=5432 dbname=daskunk_DaSkunkWorksPBC user=daskunk_php password=*****")

I tried that exact same code with my Ricky account, and it works perfectly. What is the link to your script?
Posted

THANK YOU SO MUCH!  When I initially created the daskunk_php userid (weeks ago now) it was my first time working with the Postgresql admin tools and I could've sworn I not only created the user id but added it to the database.  I went through and tried adding it again just now, and it says it was submitted successfully. So now when I run the php script I'm past the pg_connect error and on my way with actual queries!! I can't tell you how much I appreciate your help. Thank you again.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...