Reputation: 2240
I have been using Wamp server for a long time now. It comes with MySQL. Today I had to change from mysql to PostgreSQL. I've tried install Postgres, downloaded and completed the installation. But when I tried to run a php program to reteive some data from the table,
<?php
$link = pg_connect("host=192.168.2.43 dbname=DataFetcher user=postgres password=user");
echo "Connection Established";
?>
it says Call to undefined function pg_connect()
, that means Postgres is not detected.
What could be the issue?
Upvotes: 0
Views: 189
Reputation: 1281
I had the same issue. I installed wamp, enabled php_pgsql and php_pdo_pgsql successfully. But I was still unable to see pgsql installed on apache server. I found a nice explanation and solution provided by @skoobiedu at http://forum.wampserver.com/read.php?2,40270,40311
P.S. I have again given this answer because this is the correct answer for this question and @Bill deleted my answer. I request @user1371896 to accept this answer as correct answer. I also request @bill not to delete this answer as I have already removed same answer from one other post.
Upvotes: 0
Reputation: 160883
You need to enable the extention.
Something like left click wamp icon goto - php > extentions and click php_pgsql.
Upvotes: 1