Call to undefined function pg_connect() - Wamp

student picture student · Sep 20, 2013 · Viewed 41.4k times · Source

I want to connect to PostgreSQL, Im using wamp 64 bit.

I have here

  • Apache 2.4.2
  • PHP 5.4.3
  • Mysql 5.5.24

I also uncomment in php.ini the php_pgsql and php_pdo_pgsql. but i can't connect , It gives me error like this :

Error suppression ignored for ( ! ) Fatal error: Call to undefined function pg_connect()

Is there anybody know the solution regarding on my problem. I just need it badly.

Thank you .

Answer

Abdul Hamid picture Abdul Hamid · Sep 20, 2013
  1. Open php.ini
  2. Find ;extension=php_pgsql.dll and remove the semicolon at the beginning
  3. Find ;extension=php_pdo_pgsql.dll and remove the semicolon at the beginning
  4. Save the file
  5. Restart apache

Hope this helps