php pgadmin远程数据库连接失败

我想连接到从
php
postgres
的远程数据库,但它无法连接并说
 Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server:    
could not connect to server: No route to host (0x00002751/10065) Is the server running on host "xxxxxxxxx" and accepting TCP/IP connections on port 5432? in C:xampphtdocstest.php on line 4
Wrong CONN_STRING

<html> 
    <body> 
        <?php 
        $db = pg_connect('host=xxx.xxx.xxx.xxx port=5432 dbname=postgres user=postgres password=') or die('Wrong CONN_STRING'); 
        if (!$db) {
                echo 'error';
            }else{
            echo 'success';
            }

        ?> 
    </body> 
  我可以从运行apache的同一台机器上运行的
pgadmin
客户端访问同一个数据库,我无法理解pgadmin可以访问db但是apache webserver的php无法访问?任何的想法 ?     
已邀请:
“无主机路由”告诉您存在某种网络问题 - 不同客户端能够从同一主机访问它的事实表明它是某种安全限制或阻止连接的防火墙,但没有关于您的环境的详细信息,很难更具体。     
这是SELinux的问题 以下命令修复了问题 setsebool -P httpd_can_network_connect = 1     

要回复问题请先登录注册