Author Topic: configuring php for postgresql  (Read 2107 times)

0 Members and 1 Guest are viewing this topic.

Offline tpl41803Topic starter

  • Irregular
  • Posts: 42
    • View Profile
configuring php for postgresql
« on: September 14, 2009, 02:23:14 PM »
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)
Code: [Select]
extension=php_pgsql.dll

and the PostgreSQL section looks like this (haven't made any changes)
Code: [Select]
[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
Code: [Select]
./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

Offline btherl

  • Guru
  • Fanatic
  • *
  • Posts: 3,791
  • Gender: Male
  • Matt is the best!
    • View Profile
Re: configuring php for postgresql
« Reply #1 on: September 15, 2009, 03:03:57 AM »
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).
Your php questions answered at Flingbits

Offline tpl41803Topic starter

  • Irregular
  • Posts: 42
    • View Profile
Re: configuring php for postgresql
« Reply #2 on: September 15, 2009, 01:14:58 PM »
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.

Offline artacus

  • Devotee
  • Posts: 915
  • Gender: Male
  • World domination? Never heard of it.
    • View Profile
    • Flex and Specs()
Re: configuring php for postgresql
« Reply #3 on: September 15, 2009, 05:07:31 PM »
Quote
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
artacus

-- Trust your leaders, depend on your government, don't question the media... and this won't hurt a bit. --