1

I am trying to connect to Postgre using a PHP script, but it returns the following error:

Fatal error: Call to undefined function pg_connect() in C:\wamp\www\contact.php on line 2

What am I doing wrong?

2 Answers 2

4

you need to uncomment this line in php.ini:

 extension=php_pgsql.dll
Sign up to request clarification or add additional context in comments.

1 Comment

hmm... wamp server doesn't include postgresql installation... do you have postgresql server installed? and also check if you have php_pgsql.dll file in extensions folder
1

Be sure to have the postgres driver installed into PHP. Find it in your php directory, is named php_pgsql.dll and if you have it, check if found in the php ini:

;extension=php_pgsql.dll

and uncomment it:

extension=php_pgsql.dll

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.