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

 

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.