Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function pg_connect() - Wamp

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 .

like image 769
student Avatar asked Sep 20 '13 02:09

student


2 Answers

I think this will help you.

  1. Right click on my computer and select properties.
  2. Click on advance system settings
  3. On the system properties window click “environment variables”
  4. Look for system variables frame and click “Path” variable
  5. Click the “edit” button
  6. Change the variable value by adding your php root path. Mine looks like this:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\wamp\bin\php\php5.3.0\
    Just added your php root path at the end.
  7. Restart your wampserver and check mark the pdo_pgsql and php_pgsql extension using the wamp server menu or by editing your php.ini ; just remove the remark for the above extensions.
like image 101
user2695968 Avatar answered Nov 15 '22 18:11

user2695968


  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

like image 23
Abdul Hamid Avatar answered Nov 15 '22 19:11

Abdul Hamid