Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2004
    Posts
    110

    Unanswered: A few noobie problems with postgresql

    Yes, im pretty new to postgresql. To be more precise, not only to postgresql but also to Mysql and MS-SQL.

    My current setup is apache2.0, PHP4 (PHP Version 4.0.3pl1 to be precise) and postgresql 7.4.1 on a Windows 2003 Server.

    Actually the postgresql came with cygwin2.0.

    I actually was able to create a few tables, triggers and function but to my horror i am not able to connect to my db with pg_connect().

    Yes, i get the "Fatal error: Call to undefined function: pg_connect()" error.
    I found quite a few "solutions" and basicly it said to recompile PHP.

    From what i understand is that when PHP is installed on windows, it has all "options" enabled. Even spotted a few pg_ thingies in php.ini file.

    When searching for solutions something else got my attention as well. The postgres.conf file has only a few options enabled.
    If i edit the postgres.conf file.. will the new settings be enabled when i create a new db in "template1=# create database <dbname>"?

    On a side note,
    if i do have to recompile PHP on a windows machine... i'd love to see a nice link as i've been unsuccesfull in finding a link "how to...." recompile it.

    Thanks a bunch,

    -Ed

  2. #2
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up Create your Db

    You must get to the Pgsql cywin shell and create your Db, take a look to the doc www.postgresql.org/docs/ to know morea baout that's what is missing to your party to start.
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

  3. #3
    Join Date
    Mar 2004
    Posts
    110
    The problem isnt that i cant create a new db.
    I wonder if the postgres.conf (which i have edited with tcpip_socket=true) will be used by the new db.

    Further more i dont seem to be able to connect to the db with pg_connect() wich annoys the bloody hell outta me.

    -Ed

  4. #4
    Join Date
    Mar 2004
    Posts
    110
    The problem isnt that i cant create a new db.
    I wonder if the postgres.conf (which i have edited with tcpip_socket=true) will be used by the new db.

    Further more i dont seem to be able to connect to the db with pg_connect() wich annoys the bloody hell outta me.

    -Ed

  5. #5
    Join Date
    Feb 2004
    Location
    Siggenthal, Switzerland
    Posts
    19
    Did you took care of each point written here:
    http://www.sitepoint.com/print/use-p...ql-php-windows

    Did you start the postmaster with the option -i (listen to tcp/ip connection)

    /Walter

  6. #6
    Join Date
    Mar 2004
    Posts
    110
    Yes, its the walk-through i used to install cygwin and postgresql.

    Even edited the postgres.conf and set tcpip_socket=true.

    I fear it is a php related problem but im far from sure.

    -Ed

  7. #7
    Join Date
    Mar 2004
    Posts
    2
    You probably need to uncomment this line in php.ini:

    ;extension=php_pgsql.dll

    (just remove the ; in front)

    Then you need to restart Apache for the new settings to take effect.

  8. #8
    Join Date
    Mar 2004
    Posts
    110
    Thanks alot for the post, it was really helpfull.

    Indeed, in my php.ini the line extension=php_pgsql.dll was indeed preceded by (.

    After removing it.. it still didnt work.. but after i copied the php_psql.dll into both windows and windows/system32 (prolly only needed to excist in windows/system32 but hey... i just copy pasting anyways ;P)

    Thanks alot for the responds.

    -Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •