PHP/PostGreSQL Articles
am 11.02.2004 23:22:21 von David Costa
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
Can"t connect to 7.4 DB
am 12.02.2004 14:36:45 von Michael Hanna
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
Re: Can"t connect to 7.4 DB
am 12.02.2004 16:30:17 von Scott Marlowe
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.
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Re: Can"t connect to 7.4 DB
am 12.02.2004 16:31:27 von Joshua Drake
This is a multi-part message in MIME format.
--------------080803030101030905070904
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
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
--------------080803030101030905070904
Content-Type: text/x-vcard; charset=utf8;
name="jd.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="jd.vcf"
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;P.O. Box 215;Cascade Locks;OR;97014;US
email;internet:jd@commandprompt.com
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Home of Mammoth PostgreSQL, and PostgreSQL Replicator.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard
--------------080803030101030905070904
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--------------080803030101030905070904--
Re: Can"t connect to 7.4 DB
am 12.02.2004 18:50:57 von Michael Hanna
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
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Re: [PHP] PHP/PostGreSQL Articles
am 27.05.2004 15:39:50 von Nick Fankhauser
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@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org]On Behalf Of David Costa
> Sent: Wednesday, February 11, 2004 5:22 PM
> To: pgsql-php@postgresql.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
>
>
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html