louis_coetzee Posted May 28, 2009 Share Posted May 28, 2009 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); } Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 Check for PostgreSQL in phpinfo(); Quote Link to comment Share on other sites More sharing options...
louis_coetzee Posted May 28, 2009 Author Share Posted May 28, 2009 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 Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 No no, i mean create a new file called phpinfo.php and put this in it <?php phpinfo(); ?> now open it, this will give you lots of info about your PHP setup, look to see if you can find PostgreSQL Quote Link to comment Share on other sites More sharing options...
louis_coetzee Posted May 28, 2009 Author Share Posted May 28, 2009 yeh, I am using wamp server, dit use phpinfo(). Did'nt find anything on postgresql Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 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) Quote Link to comment Share on other sites More sharing options...
louis_coetzee Posted May 28, 2009 Author Share Posted May 28, 2009 Have done that. when I try this: echo extension_loaded('pgsql'); ---->> Nothing echo extension_loaded('mysql'); ------->> 1 Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 So does it appear in PHPINFO now ? see here http://www.php.net/manual/en/pgsql.setup.php Quote Link to comment Share on other sites More sharing options...
louis_coetzee Posted May 28, 2009 Author Share Posted May 28, 2009 So does it appear in PHPINFO now ? see here http://www.php.net/manual/en/pgsql.setup.php nope! But when I go to look at wamp extentions, in wamp. it appears to be enabled. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 28, 2009 Share Posted May 28, 2009 try the php User Contributed Notes Quote Link to comment 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.