Integration of postgreSQL on WAMP
Solution 1
- After installation of PostgreSQL, you need to copy
libpq.dll
fromwamp\bin\php\phpX.X.X
towamp\bin\apache\Apache2.2*\bin
. And restart the Wampserver. - Download phpPgAdmin here.
- Extract phpPgAdmin-5.1.zip in
C:\wamp\apps
So the path will be,C:\wamp\apps\phpPgAdmin-5.1
. -
Create a file called
phppgadmin.conf
inC:\wamp\alias
. And copy paste the following :Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/" <Directory "C:/wamp/apps/phpPgAdmin-5.1/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all </Directory>
-
Left Click on the Wampserver Tray icon. Navigate to PHP > PHP extension. Then enable this
a. php_pgsql b. php_pdo_pgsql extension.
-
Open
C:\wamp\apps\phpPgAdmin-5.1\conf\config.inc.php
,a. find
$conf['servers'][0]['host'] = '';
change to$conf['servers'][0]['host'] = 'localhost';
b. find$conf['extra_login_security'] = true;
changetrue
tofalse
Restart All service
Go to
http://localhost/phppgadmin/
and try to login.-
Default Login credentials are
- Username = "postgres"
- Password = "root"
references :
Solution 2
Thank you. These instructions worked once I also added 'Require local' to the phppgadmin.conf file:
Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/"
<Directory "C:/wamp/apps/phpPgAdmin-5.1/">
Require local
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Solution 3
Don't forget that WAMP has two php.ini
files. One in Apache directory, one in php directory (bin\php\php5.X.X
). Wampserver Tray manages the one in Apache directory.
To be able to run php cli tools (e.g php artisan
), you need to uncomment the php_pgsql
and php_pdo_pgsql
in the php.ini
in php directory.
Solution 4
it worked thank you
Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/"
<Directory "C:/wamp/apps/phpPgAdmin-5.1/">
Require local
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Ammar Hayder Khan
My name is Ammar Khan. I am a Full-Stack developer from Pune(India), skilled in AngularJS 1/2/4, React/Redux, NodeJS(Express), MongoDB, MySQL, and PHP(CodeIgniter). I have around 10 years of experience in Web development. I have started my carrier with LAMP/WAMP stack and now I am working mainly on JS from the last 5 years.
Updated on March 17, 2022Comments
-
Ammar Hayder Khan about 2 years
I have just installed the postgreSQL on windows 7. I am trying to integrate postgreSQL with WAMP server. For this i have done the following changes in httpd.conf and php.ini file
1 LoadModule
c:/path
tolibpq.dll
inhttpd.conf
and then2
extension=php_mod_pgsql.dll
,extension=php_pgsql.dll
-- enable(reemove ;) inphp.ini
If I do the above changes the localhost does not work.
If I do the second changes the localhost work but does not load the
libpq.dll
.I checked the pgsql by php script by this
<?php echo extension_loaded('pgsql') ? 'yes':'no'; ?>
The script shows "yes", but apache is not loading the
libpq.dll
. Now what i should do for load the postgreSQL into the Apache2.2* (wamp) -
Raj about 9 yearsThanks buddy it works! But what is the login credentials for login to phppgadmin?
-
Raj about 9 yearsHey I salved this buddy I got the default password too: Username = "postgres" Password = "root".
-
KingRichard over 8 yearsThis is still extremely helpful information! Thanks for answering this question. It solved all of my initial problems, but now I get a 403 error when I try to navigate to localhost/phppgadmin Any ideas how to solve it?
-
KingRichard over 8 yearsnvm. found it here
-
Chad over 6 yearsmake sure your paths for WAMP are right. Mine is in
c:/wamp64/
-
sid.s over 5 yearsi am unable to copy the libpq.dll to the bin folder, it says the the file is being used,please close the folder.although all folders are closed
-
Pankaj over 5 yearsAdding 'Require local' helped me too. Thanks Jessica.
-
Pankaj over 5 years@sid.s: copying libpq.dll is showing that error because its used by a symlink (symbolic link) which might present in the wamp\bin\apache\Apache2.2*\bin. removing or renaming this will allow you to copy in the folder.
-
crwang over 3 yearsI added "Require local" to the
phppgadmin.conf
file inC:\wamp64\alias
to enable the use of phpPgAdmin (Source: https://stackoverflow.com/questions/24414358/http-localhost-phppgadmin-403-forbidden)