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
https://forums.phpfreaks.com/topic/160002-call-to-undefined-function-pg_connect/
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

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.