PHP and POSTGRES under windows

I have recently installed PHP and postgres(windows
version by peerdirect) I accomplished linking the
extension of postgres to php and made postgres to work
with pgadminnII but I can't connect to the database
using postgres functions this error always shows up on
my page:
"Unable to connect to PostgreSQL server:
connectDBStart() -- socket() failed: errno=2 No such
file or directory "
and this code is what I use to connect to the DB
"<?php
// Database variables
// $dbhost = "db";
$dbname = "hbcdb";
$dbusername = "Mondi0924";
$dbpassword = "1236964";

$dbconn = pg_connect("dbname=$dbname
user=$dbusername password=$dbpassword port=80");
if (!$dbconn)
{
header("Location: error.php3?errorcode=1");
exit;
}
?>"
I have been using postgres in the office using a linux
server thats why I need postgres at home could you
please help me thx.


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo [at] postgresql.org so that your
message can get through to the mailing list cleanly
Raymond Chua Sing [ Sa, 15 Februar 2003 06:41 ] [ ID #31320 ]

Re: PHP and POSTGRES under windows

We use this at work

pg_connect("host=3D{$hostname} dbname=3D{$dbname} user=3D{$user}
password=3D{$password}"))

I don't think you need to specify the port....

-----Original Message-----
From: Raymond Chua Sing [mailto:mondi0924 [at] yahoo.com]
Sent: 15 February 2003 05:42
To: pgsql-php [at] postgresql.org
Subject: [PHP] PHP and POSTGRES under windows


I have recently installed PHP and postgres(windows
version by peerdirect) I accomplished linking the
extension of postgres to php and made postgres to work
with pgadminnII but I can't connect to the database
using postgres functions this error always shows up on
my page:
"Unable to connect to PostgreSQL server:
connectDBStart() -- socket() failed: errno=3D2 No such
file or directory "
and this code is what I use to connect to the DB
"<?php
// Database variables
// $dbhost =3D "db";
$dbname =3D "hbcdb";
$dbusername =3D "Mondi0924";
$dbpassword =3D "1236964";

$dbconn =3D pg_connect("dbname=3D$dbname
user=3D$dbusername password=3D$dbpassword port=3D80");
if (!$dbconn)
{
header("Location: error.php3?errorcode=3D1");
exit;
}
?>"
I have been using postgres in the office using a linux
server thats why I need postgres at home could you
please help me thx.


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo [at] postgresql.org so that your
message can get through to the mailing list cleanly


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Grant Henderson [ Mo, 17 Februar 2003 10:38 ] [ ID #31321 ]

Re: PHP and POSTGRES under windows

port 80 is typically http - the default for pgsql is 5432.


At 12:41 AM 2/15/03, Raymond Chua Sing wrote:
>I have recently installed PHP and postgres(windows
>version by peerdirect) I accomplished linking the
>extension of postgres to php and made postgres to work
>with pgadminnII but I can't connect to the database
>using postgres functions this error always shows up on
>my page:
>"Unable to connect to PostgreSQL server:
>connectDBStart() -- socket() failed: errno=2 No such
>file or directory "
>and this code is what I use to connect to the DB
>"<?php
> // Database variables
> // $dbhost = "db";
> $dbname = "hbcdb";
> $dbusername = "Mondi0924";
> $dbpassword = "1236964";
>
> $dbconn = pg_connect("dbname=$dbname
>user=$dbusername password=$dbpassword port=80");
> if (!$dbconn)
> {
> header("Location: error.php3?errorcode=1");
> exit;
> }
>?>"
>I have been using postgres in the office using a linux
>server thats why I need postgres at home could you
>please help me thx.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html
Frank Bax [ Mo, 17 Februar 2003 16:55 ] [ ID #31324 ]
Datenbanken » gmane.comp.db.postgresql.php » PHP and POSTGRES under windows

Vorheriges Thema: tcp connections
Nächstes Thema: Re: Issues to consider when upgrading to PostgreSQL 7.3