Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem? (fwd)

From: Terry Mackintosh <terry(at)terrym(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: Robert Chalmers <robert(at)chalmers(dot)com(dot)au>
Subject: Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem? (fwd)
Date: 1998-12-27 17:40:51
Message-ID: Pine.LNX.3.95.981227123609.5666B-100000@terry1.acun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi again Robert

I forgot to mention also that postmaster needs to be started with the '-i'
option. This may be the main problem.

The older versions used TCP/IP sockets by default, the current version
uses UNIX domain sockets by default, you need TCP/IP sockets for PHP, the
'-i' option says to use TCP/IP sockets.

Terry Mackintosh <terry(at)terrym(dot)com> http://www.terrym.com
sysadmin/owner Please! No MIME encoded or HTML mail, unless needed.

Proudly powered by R H Linux 4.2, Apache 1.3, PHP 3, PostgreSQL 6.4
-------------------------------------------------------------------
Success Is A Choice ... book by Rick Patino, get it, read it!

---------- Forwarded message ----------
Date: Sun, 27 Dec 1998 09:09:29 -0500 (EST)
From: Terry Mackintosh <terry(at)terrym(dot)com>
To: Robert Chalmers <robert(at)chalmers(dot)com(dot)au>
Cc: pgsql-admin(at)postgreSQL(dot)org, php <php3(at)lists(dot)php(dot)net>
Subject: Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem?

Hi Robert

On Sun, 27 Dec 1998, Robert Chalmers wrote:

> Since I have updated, either php3, or pgsql, is refusing a connection from the
> php3 engine to the database.
> ....
> <html>
> <body>
> <?php $database = pg_connect("host=nanguo dbname=ecotourism port=5432"); ?>

I use PHP 3 all the time, and have never seen the above syntax, is that
PHP/FI syntax? so that may be your problem. Here is how I do it:

if ( !($database = pg_connect("localhost","5432","","","ecotourism")))
{// NOTE the use of 'localhost', if it's all on 1 box, thats all you need.
echo "Bad connection to database!<p>Sorry<p>.\n";
}
else
{
// Good to go!
}

> <br>
> <?php if ($database):
> echo "Database Connection.";
> else:
> echo "Database NOT Connected.";
> endif;
> ?>
> <br>
> </body>
> </html>

Hope that helps
Terry Mackintosh <terry(at)terrym(dot)com> http://www.terrym.com
sysadmin/owner Please! No MIME encoded or HTML mail, unless needed.

Proudly powered by R H Linux 4.2, Apache 1.3, PHP 3, PostgreSQL 6.4
-------------------------------------------------------------------
Success Is A Choice ... book by Rick Patino, get it, read it!

Browse pgsql-admin by date

  From Date Subject
Next Message Jouni Ahto 1998-12-27 19:04:17 Re: [PHP3] pgsql + php3 expert needed. Can you solve this problem?
Previous Message Terry Mackintosh 1998-12-27 14:09:29 Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem?