Re: Fatal error: Call to undefined function: pg_connect() in .....
| From: | Miles Thompson | Date: | Fri, 19 Jul 2002 02:02:13 +0000 |
| Subject: | Re: Fatal error: Call to undefined function: pg_connect() in ..... | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-20649@lists.php.net to get a copy of this message | ||
Is PostgreSQL started with the -i switch? (I think that's the one; it exposes it to tcp/ip connections.) Check your PGSQL docs to be certain.
Have you run a page with phpinfo? Is PostgreSQL support compiled into your installation of PHP? This is a file consisting of
<? phpinfo(); ?>, named phpinfo.php. Again, I'm doing this from memory but I'm pretty certain of the function name.
If you have a yes to those questions, then we can start on the rest. Check to see if there is a pg_error function you can call if the connection fails. Keep error reporting at a high level so we can see what they are.
Regards - Miles Thompson
At 06:37 PM 7/18/2002 -0700, Vincent wrote:
Hi, I'm a newbie here. I don't know what went wrong. I've tried searching for solutions and can't find any. How come pg_connect() isn't defined? Should I include any header files or something in php? Here's my code: <?php $conn = pg_connect("dbname=phpdb"); if (!$conn) { echo "Unable to connect to database "; } else print "Connected"; ?> I've tried installing Apache's rpm and Php's rpm. I'm running on RedHat Linux 7.3. apache_1.3.23-11.i386.rpm and php-4.1.2-7.rpm. Then, it still gives me the error message. So, I tried the gz version using apache_1.3.26.tar.gz and php-4.2.1.tar.gz. Nothing works. I've tried looking into the php.ini files, adding extension to pgsql.so. Have any of you encountered this problem before? __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php