afroncio Posted August 6, 2007 Share Posted August 6, 2007 Here is my code: <?php // Connect to the database: $dbconn = pg_connect("host=xxx.com dbname=xxxx user=postgres password=xxxxxxxx") or die('Could not connect: ' . pg_last_error()); ?> And the result is: $ php dash_data.php Fatal error: Call to undefined function: pg_connect() in /Users/afroncio/Sites/dashboard/dash_data.php on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/63590-pg_connect-not-working-for-me/ Share on other sites More sharing options...
btherl Posted August 7, 2007 Share Posted August 7, 2007 Does your hosting provider support postgres? Quote Link to comment https://forums.phpfreaks.com/topic/63590-pg_connect-not-working-for-me/#findComment-317159 Share on other sites More sharing options...
Oldiesmann Posted August 10, 2007 Share Posted August 10, 2007 PHP needs to be compiled with "--with-pgsql" for pg_connect() (and other PostgreSQL functions) to work. Either your host doesn't support PostgreSQL, or they forgot to compile PHP with PostgreSQL support (in which case they should be willing to recompile PHP to fix this issue). Quote Link to comment https://forums.phpfreaks.com/topic/63590-pg_connect-not-working-for-me/#findComment-320538 Share on other sites More sharing options...
the_oliver Posted August 13, 2007 Share Posted August 13, 2007 Try running <?php phpinfo(); ?> and look to see wheater postgres support is installed/turned on. Quote Link to comment https://forums.phpfreaks.com/topic/63590-pg_connect-not-working-for-me/#findComment-322799 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.