Thread: Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem? (fwd)
Re: [ADMIN] pgsql + php3 expert needed. Can you solve this problem? (fwd)
From
Terry Mackintosh
Date:
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@terrym.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@terrym.com> To: Robert Chalmers <robert@chalmers.com.au> Cc: pgsql-admin@postgreSQL.org, php <php3@lists.php.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@terrym.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!