Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

[PHP-DB] Error -> connect() failed: No route to host From: Jeff Fitzmyers (fitz22 <email protected>)
Date: 12/13/00

I get this error message

Unable to connect to PostgreSQL server:
Warning: Unable to connect to PostgreSQL server: connectDBStart()
-- connect() failed: No route to host
Is the postmaster running (with -i) at '127.0.0.1' and accepting
connections on TCP/IP port '5432'?
in /usr/local/apache/htdocs/quote.php on line 21

PG v 7.03
php v 4.0.3pl1
apache v 1.3.14
Freebsd 4.2

netstat -a
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 *.5432 *.* LISTEN
tcp4 0 0 *.6000 *.* LISTEN
tcp4 0 0 *.http *.* LISTEN
tcp4 0 0 *.smtp *.* LISTEN
tcp4 0 0 *.sunrpc *.* LISTEN
tcp4 0 0 asa.domain *.* LISTEN
udp4 0 0 *.sunrpc *.*
udp4 0 0 *.1042 *.*
udp4 0 0 asa.domain *.*
udp4 0 0 *.syslog *.*
udp4 0 0 *.router *.*

ps -aux
postgres 77504 0.0 1.6 4000 1940 ?? Is 6:28AM 0:00.00 \
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data -i -S
(postgres)

I did configure php statically with: --with-pgsql=/usr/local/pgsql
yet phpinfo() only shows (and for two days ago):
'./configure' '--with-apache=../apache_1.3.14'
And there is a table titled pgsql showing
pgsql.allow_persistent on on

Apache table
Hostname:Port 127.0.0.1:80
Apache Environment table
HTTP_HOST 192.168.1.1
HTTP_REFERER http://192.168.1.1/
REMOTE_ADDR 192.168.1.1
SERVER_ADDR 192.168.1.1
SERVER_NAME 127.0.0.1

Environment table shows:
LD_LIBRARY_PATH /usr/local/pgsql/lib
HOST asa.my.domain

In fact I have removed all php and apache files I could find and reinstalled
from tar files multiple times.

ifconfig
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::202:b3ff:fe0c:549f%fxp0 prefixlen 64 scopeid 0x1
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
        inet6 ::1 prefixlen 128

The query is:
$conn = pg_Connect("host=127.0.0.1 port=5432 user=web password=web dbname=cast");
if (!$conn) {
        echo "An error occured connectin to the data base.";
        exit;
}
$sql="SELECT * FROM quote;";
$result_set=pg_Exec($conn, "$sql");

I do have a PG user with id=web password=web and a database named cast
with 5
rows.

Any ideas??

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>