M
M
Miroslav Prikhodko2018-04-16 09:45:26
PHP
Miroslav Prikhodko, 2018-04-16 09:45:26

Can't connect to postgres database, what's the problem?

On Linux Ubuntu Server 16.04(64-bit) web-server apache 2.2 postgres 9.5 php 7.2 and phppgadmin are installed and
so I connect to the database with this script:
<?php
$db=pg_connect ('host=localhost port=5432 dbname=base user =postgres password=1q2w3e ');
if(!db){
die ('Failed to connect to database');
}
?>
So I can't connect, although all the data is correct (I checked it with phppgadmin), I changed localhost to 127.0.0.1 and even to ip in the local network, nothing changes ..... tell me what could be...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2018-04-16
Tag

why guess ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question