LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-04-2005, 02:28 AM   #1
jkmartha
Member
 
Registered: Apr 2005
Location: india
Distribution: Redhat 9
Posts: 66

Rep: Reputation: 15
unable to connect to postgres from php


i have written a small php code. when i try to access it on webpage, its not showing.


<?php

$dbconn = pg_connect("host=localhost port=5432 dbname=martha");
echo pg_dbname();
?>





the log file message is ::



[client 192.168.1.13] PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: \xec0\xd2\n\tIs the server running on host &quot;localhost&quot; and accepting\n\tTCP/IP connections on port 5432?\n. in /var/www/html/sample1.php on line 5
[client 192.168.1.13] PHP Warning: pg_dbname(): No PostgreSQL link opened yet. in /var/www/html/sample1.php on line 7
_________________
 
Old 07-04-2005, 02:51 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Can you connect to PostgreSQL by other means than
PHP? E.g. from a command-line using psql?


Cheers,
Tink
 
  


Reply



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
Apache PHP Postgres works but not together... PeO Linux - Software 1 10-12-2005 08:01 AM
php postgres connecting needed help vickr1z Linux - Newbie 2 11-11-2004 03:13 AM
php postgres problem Xing Linux - Software 3 03-08-2004 12:22 PM
connect two databases using postgres? w0000422 Programming 3 02-21-2004 02:18 PM
postgres connect richard22 Linux - Software 4 01-29-2003 12:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:20 PM.

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