Jump to content

configuring php for postgresql


tpl41803

Recommended Posts

I'm just learning my way around PHP! Everything I haven't been able to figure out you guys have helped me with.

 

I've decided that flatfile databases won't work for the projects I've been asked to work on recently so I am trying out Postgresql -- I had a really hard time working with MYSQL, I just didn't understand how it was working about a year ago when I tried it out. Postgresql seems to be pretty straightforward and I have gotten it installed onto my server. HOWEVER, when I run any php scripts, it doesn't seem to be working.

 

I have determined that my installation of PHP doesn't have postgresql enabled or activated.

 

I have searched around (both here, on other forums, and websites) and I can't figure out how to get it working properly.

 

my php.ini, I believe, has it enabled properly:

 

I added this line under DYNAMIC EXTENSIONS (according to a tutorial I found somewhere)

extension=php_pgsql.dll

 

and the PostgreSQL section looks like this (haven't made any changes)

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links.  -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Notice message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
pgsql.log_notice = 0

 

Everything I have found tells me I need to enter

./configure --with-pgsql

 

Into the PHP configuration script, but I can't for the life of me figure out where to enter this.

 

Please help :-D

 

That "configure" line is for if you compile php yourself with postgres support.

 

How did you install php?  And the webserver?  If you installed them as some kind of pre-packaged thing, then that packaging system should have a way to set up postgres to work with it (I'm being very general here because I'm more of a linux person and you appear to be using windows).

Yes I work on windows. At the moment I am just working on my local server (apache). I'm not much of a programing guru so I downloaded the pre-packaged executables for windows (both Apache, PHP, and now postgres).

 

I hadn't thought to try to re-install php, I can give that a shot. But when I installed it I don't remember any settings choices during the installation.

pre-packaged executables for windows (both Apache, PHP, and now postgres).

 

By pre-packaged, he means the whole stack bundled together not one package for PHP and another for Apache...

Like XAMPP or WAMP.

 

http://www.apachefriends.org/en/xampp.html

http://www.devside.net/server/webdeveloper

http://bitnami.org/article/apache-php-and-postgresql-all-in-one

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.