简体   繁体   English

php中的pg_connect返回false

[英]pg_connect in php return false

I show phpinfo() info page has pgsql enable support But in file php 我显示phpinfo()信息页面具有pgsql启用支持,但是在文件php中

$dbconn =pg_connect("host=localhost port=5432 dbname=qlbv user=postgres password=123456")
 or die("can't connect db"); 

result of $dbconn is false; $ dbconn的结果为假;

I had config 我有配置

# "local" is for Unix domain socket connections only
local  all        all                              md5   
# IPv4 local connections:
host    all        all        127.0.0.1/32        md5   
# IPv6 local connections:
host    all        all        ::1/128              md5   
# IPv4 internet connections:
host    all        all        0.0.0.0/0            md5 

# - Connection Settings -
listen_addresses='*'
#listen_addresses = 'localhost'        # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                            # (change requires restart)

I setup webserver in centos result of $dbconn is false; 我在centos中将$ server设置为$ dbconn,结果为false; Can you help me? 你能帮助我吗? thanks! 谢谢!

you try types: 您尝试输入:

getsebool -a | grep ftp
setsebool -P ftp_home_dir on
getsebool -a | grep ftp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM