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无法访问?任何的想法 ?
没有找到相关结果
已邀请:
2 个回复
荒劫娇噬
陷牡彭拈峰