PHP/PostGreSQL Articles

Lists: pgsql-advocacypgsql-php
From: David Costa <geeks(at)dotgeek(dot)org>
To: pgsql-php(at)postgresql(dot)org
Subject: PHP/PostGreSQL Articles
Date: 2004-02-11 22:22:21
Message-ID: C272C052-5CE0-11D8-B5E4-000A95EB456A@dotgeek.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

Hello ;)

I manage a small albeit promising website (not for profit, no ads, no
subscriptions) dedicated to PHP Programming (http://www.dotgeek.org)

We (I) are looking for writers on the following topics:

-Articles with examples of PHP and postgresql development
- Migration from Mysql to Postgresql

I might be willing to pay for good articles, (payment per article or on
a deal basis).

The budget is modest but it could fit well if you are a student and
have some spare time handy.

It could be something fun and interesting at the same time.

Feel free to msg email me at geeks at dotgeek dot org for any further
information,

Regards
David Costa


From: Michael Hanna <taojones(at)sympatico(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: Can't connect to 7.4 DB
Date: 2004-02-12 13:36:45
Message-ID: 80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

Hi this php code:


// add to DB

// database access parameters
$host = "localhost";
$user = "postgres";
$pass = "postgres";
$db = "cosc3p94";

// open a connection to the database server
$connection = pg_connect("host=$host dbname=$db user=$user
password=$pass");

if (!$connection)
{
die("Could not open connection to database server");
}

...

results in:

Could not open connection to database server

and I'm not sure why. The web browser, web server, and database are on
the same machine..

I checked the pg_hba.conf and it says this:

# TYPE DATABASE USER IP-ADDRESS IP-MASK
METHOD

local all all
trust
# IPv4-style local connections:
host all all 127.0.0.1 255.255.255.255
trust
# IPv6-style local connections:
host all all ::1
ffff:ffff:ffff:ffff:ffff:ffff:ff$

which is untouched from the default settings...

Michael


From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Michael Hanna <taojones(at)sympatico(dot)ca>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Can't connect to 7.4 DB
Date: 2004-02-12 15:30:17
Message-ID: Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

OK, here's a little trick you may not be aware of.

pg_connect("dbname=mydb user=stan");

will open a local unix domain socket.

pg_connect("host=127.0.0.1 dbname=mydb user=stan");

will open a local TCP/IP connection on the loopback interface.

In order for this to work, your postgresql.conf must have this line
changed:
#tcpip_socket = false
to
tcpip_socket = true

and your pg_hba.conf needs a line like this:

host all all 127.0.0.1 255.0.0.0 trust

So it's likely the "secure by default" mentality of postgresql that's
biting you here.


From: Joshua Drake <jd(at)commandprompt(dot)com>
To: Michael Hanna <taojones(at)sympatico(dot)ca>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Can't connect to 7.4 DB
Date: 2004-02-12 15:31:27
Message-ID: 402B9C4F.2070802@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

Hello,

What does the PostgreSQL log say? Is it even getting to the server? What
abour the apache error log? Does it reflect an error?

Sincerely,

Joshua D. Drake

Michael Hanna wrote:
> Hi this php code:
>
>
>
> // add to DB
>
> // database access parameters
> $host = "localhost";
> $user = "postgres";
> $pass = "postgres";
> $db = "cosc3p94";
>
> // open a connection to the database server
> $connection = pg_connect("host=$host dbname=$db user=$user
> password=$pass");
>
> if (!$connection)
> {
> die("Could not open connection to database server");
> }
>
>
> ...
>
> results in:
>
> Could not open connection to database server
>
> and I'm not sure why. The web browser, web server, and database are on
> the same machine..
>
> I checked the pg_hba.conf and it says this:
>
> # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
>
> local all all trust
> # IPv4-style local connections:
> host all all 127.0.0.1 255.255.255.255 trust
> # IPv6-style local connections:
> host all all ::1
> ffff:ffff:ffff:ffff:ffff:ffff:ff$
>
>
> which is untouched from the default settings...
>
> Michael
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

Attachment Content-Type Size
jd.vcf text/x-vcard 347 bytes

From: Michael Hanna <taojones(at)sympatico(dot)ca>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Can't connect to 7.4 DB
Date: 2004-02-12 17:50:57
Message-ID: 033FCEAF-5D84-11D8-9833-000A95B34330@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

yes, this was the problem, thanks...

On 12-Feb-04, at 10:30 AM, scott.marlowe wrote:
>
> In order for this to work, your postgresql.conf must have this line
> changed:
> #tcpip_socket = false
> to
> tcpip_socket = true


From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "David Costa" <geeks(at)dotgeek(dot)org>
Cc: "Pgsql-Advocacy(at)Postgresql(dot) Org" <pgsql-advocacy(at)postgresql(dot)org>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: [PHP] PHP/PostGreSQL Articles
Date: 2004-05-27 13:39:50
Message-ID: NEBBLAAHGLEEPCGOBHDGKEIDMLAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-advocacy pgsql-php

Hi David-

Although you'll find the PHP experts on this list, you may have more luck
finding authors on the advocacy list. I'll cc the advocacy list on this
response. I'm pretty sure that migration from MySQL to PostgreSQL will be a
popular topic in that group.

Regards,
-Nick

> -----Original Message-----
> From: pgsql-php-owner(at)postgresql(dot)org
> [mailto:pgsql-php-owner(at)postgresql(dot)org]On Behalf Of David Costa
> Sent: Wednesday, February 11, 2004 5:22 PM
> To: pgsql-php(at)postgresql(dot)org
> Subject: [PHP] PHP/PostGreSQL Articles
>
>
> Hello ;)
>
> I manage a small albeit promising website (not for profit, no ads, no
> subscriptions) dedicated to PHP Programming (http://www.dotgeek.org)
>
> We (I) are looking for writers on the following topics:
>
> -Articles with examples of PHP and postgresql development
> - Migration from Mysql to Postgresql
>
> I might be willing to pay for good articles, (payment per article or on
> a deal basis).
>
> The budget is modest but it could fit well if you are a student and
> have some spare time handy.
>
> It could be something fun and interesting at the same time.
>
> Feel free to msg email me at geeks at dotgeek dot org for any further
> information,
>
> Regards
> David Costa
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>