Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-11-2004, 12:23 AM   #1
Registered: Mar 2004
Location: manila, philippines
Distribution: RH 7.3
Posts: 63

Rep: Reputation: 15
php postgres connecting needed help

goo day to all.

id like to ask if how can i make a php script to connect on remote postgres server.
let say my localhost was and the remote postgres server host was

any idea? thanks again in advance, and more power!

Old 11-11-2004, 01:54 AM   #2
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
first make sure the postgres server is tcp/ip enabled, second make sure php is postgres enabled, then you can use this php code:
$connection = pg_connect("host= port=5432 dbname=<database name> user=<user> password=<password>");
all arguments are optional, and have default values wich can be set. check the php documentation on postgresql.

.-=~ iluvatar ~=-.
Old 11-11-2004, 03:13 AM   #3
Registered: Aug 2004
Location: Northbrook, Illinois
Distribution: CentOS-5
Posts: 311

Rep: Reputation: 30
just being proactive here--make sure the firewall on the postgres server is allowing connections on port 5432 and if it's behind a router make sure its forwarded.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
postgres dump needed help. vickr1z Linux - Newbie 3 11-10-2004 03:22 AM
postgres COPY function needed help vickr1z Linux - Newbie 1 11-08-2004 05:36 AM
php postgres problem Xing Linux - Software 3 03-08-2004 12:22 PM
Error connecting to postgres with pgAdmin koswo Linux - Software 1 02-10-2004 07:45 AM
Connecting a Postgres Database from a Java application Paulo Ges Programming 4 08-23-2003 10:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration