Dear All

What's wrong ? I will connect to a postgres
db ,but it return the following error:
Fatal error: Call to undefined function: pg_connect() /usrlocal/apache/htdocs/CheckUser.php on line 3

Please help me to solve the problem !

Douglas Yau
2000/10/04

    Sound like you don't have postresql support for PHP. Check your php.ini file for
    extension=php_pgsql.dll and uncomment it !!

    DAN
    Hope it will work !!

      Also if you don't have direct access to the ini file, use

      echo phpversion();

      for the version and

      echo phpinfo();

      To see if support for your database is enabled.

      I had this problem earlier when include_once wasn't working, and it turned out include_once works with php 4 and my host had php 3 on, heh.

        8 months later

        Can you let me know how to restart php after uncommenting the line in the php.ini file?

        Thanks

          a month later

          You don't restart php itself, you restart the http server. If you have apache, use the command 'apachectl restart' as root.

            9 months later

            If you are on a Linux box then check your php.ini file

            It should have a line like

            extension = pgsql.so

            (the rough equivalent to a dll on a windows box)

            there is also an extension directory line. The pgsql.so file should reside in that directory. I don't think you are allowed to put a path in the extension statment i.e. extension = /usr/lib/apache/php/pgsql.so IS WRONG.

            Regards

            David Evans

              3 months later

              I understand all, but my configuration is W98 + Apache + PHP en cgi mode (with apache is the only options). PHP works, but pg_connect() no ¿I make a modify in php.ini in c:\windows\php.ini or other place?

              Thank's

                Write a Reply...