HELP ME OUT : POSTGRESQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nader

    #1

    HELP ME OUT : POSTGRESQL

    Everytime I try to connect to my postgreSQL server I get this error :

    PHP Fatal error: Call to undefined function: pg_connect() in
    c:\inetpub\wwwr oot\test.php on line 4


  • Jerry Gitomer

    #2
    Re: HELP ME OUT : POSTGRESQL

    On Mon, 03 May 2004 15:09:02 +0200, nader wrote:
    [color=blue]
    > Everytime I try to connect to my postgreSQL server I get this error :
    >
    > PHP Fatal error: Call to undefined function: pg_connect() in
    > c:\inetpub\wwwr oot\test.php on line 4[/color]

    I had the same problem, but I was able to avoid it by using Pear::DB. If
    you have a recent version of PHP (4.3(?) and later) Pear is included.
    There is a Pear::DB primer at www.onlamp.com/lpt/a/1356. I found it easy
    to use and like the idea of being able to use port from MySQL to
    PostgreSQL by changing only one parameter in the DB::Connect parameter
    list.

    HTH
    Jerry

    Comment

    • Drazen Gemic

      #3
      Re: HELP ME OUT : POSTGRESQL

      On Mon, 03 May 2004 15:09:02 +0200, nader wrote:
      [color=blue]
      > Everytime I try to connect to my postgreSQL server I get this error :
      >
      > PHP Fatal error: Call to undefined function: pg_connect() in
      > c:\inetpub\wwwr oot\test.php on line 4[/color]

      Obviously you are runnin Posgres on win32. I have expirience
      with Postgres on UNIX systems only, but, maybe, I can help.


      Is there a psql command available on win32. Can you connect
      with it ?

      Is the Postgres on the same machine as your web server ?

      --
      Ask yourself: are you ready for the enterprise ?

      Comment

      • Mauro Morales M.

        #4
        Re: HELP ME OUT : POSTGRESQL

        You can't connect to postgresql because you are not installed php-postgres
        module in your apache-php installation.

        Install this module and try again.

        --
        Mauro Morales M.
        mailto:mmm@tier ramedia.org
        Linux User # 160358

        "nader" <nader@infomani ak.ch> escribió en el mensaje
        news:409644ac$0 $706$5402220f@n ews.sunrise.ch. ..
        : Everytime I try to connect to my postgreSQL server I get this error :
        :
        : PHP Fatal error: Call to undefined function: pg_connect() in
        : c:\inetpub\wwwr oot\test.php on line 4
        :
        :


        Comment

        • Terence

          #5
          Re: HELP ME OUT : POSTGRESQL

          Mauro Morales M. wrote:
          [color=blue]
          > You can't connect to postgresql because you are not installed php-postgres
          > module in your apache-php installation.
          >
          > Install this module and try again.
          >[/color]

          Yeah this is pretty much the issue (nothing to do with PEAR or whatever).

          on windows, all you need to do is:

          - uncomment the following line "extension=php_ pgsql.dll" in
          c:\windows\php. ini

          - make sure you copy php_pgsql.dll from the C:\php\extensio ns to
          c:\windows\syst em32

          - restart the web server

          on unix, you have to compile it into php.

          Comment

          • Andy Hassall

            #6
            Re: HELP ME OUT : POSTGRESQL

            On Fri, 07 May 2004 12:42:46 +1000, Terence <tk.lists@fastm ail.fm> wrote:
            [color=blue]
            >- make sure you copy php_pgsql.dll from the C:\php\extensio ns to
            >c:\windows\sys tem32[/color]

            No, don't do that, set extension_dir properly and leave the DLL there. Don't
            start polluting your system directories.

            --
            Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
            http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

            Comment

            • leon
              New Member
              • Apr 2006
              • 1

              #7
              I started receiving this condition when upgrading PHP to 5.1.2

              What if:
              - Apache is running fine
              - PHP is configured and working in other areas
              - The extension dir is set
              - The dll extension for postgres is uncommented
              basically everything is fine, except postgres is not loaded when the script is called? The only reason I can think, is that PHP 5.1.2 has a bug.

              Is there any other suggestion, other than trying to revert back to an older version?

              Comment

              Working...