Jump to content

Call to undefined function pg_connect()


louis_coetzee

Recommended Posts

Call to undefined function pg_connect()

I enabled the php_pgsql, but get this error when calling pg_connect()

 

function db_connect()
{
$conn_string = 'host=localhost port=5432 dbname=db user=user password=passw';
$dbconn = pg_connect($conn_string);
}

Link to comment
Share on other sites

Check for PostgreSQL in phpinfo();

PHP.ini Configuration, found nothing searching phpinfo();

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links.  -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Noitce message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
pgsql.log_notice = 0

Link to comment
Share on other sites

Okay postgresql is not loading,

 

1. check your editing the correct php.ini (in phpinfo look for "Loaded Configuration File") then open that file and check it.

2. check the extension exists (in phpinfo find "extension_dir" open that folder and check their for the extension)

3. restart apache (WAMP)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.