Suresh Dasari
Editor
5 min read | 5 years ago

Install PostgreSQL in XAMPP on Windows and integrate phpPgAdmin

Install PostgreSQL in XAMPP on Windows and integrate phpPgAdmin
In this tutorial, we will show you how to install PostgreSQL on your local system for learning and practicing PostgreSQL

There are three steps to complete the PostgreSQL installation :
1. Download PostgreSQL installer for Windows
2. Install PostgreSQL
3. Verify the installation

Download PostgreSQL Installer for Windows
First, you need to go to the download page of PostgreSQL installers on the EnterpriseDB
Second, click the download link
It will take a few minutes to complete the download.

Install PostgreSQL step by step
1. Double click on the installer file, an installation wizard will appear and guide you through multiple steps where you can choose different options that you would like to have in PostgreSQL.
2. Click the Next button
3. Assuming XAMPP is located in D:\xampp; using the pgSQL installer, install postgreSQL, we will choose D:\xampp\pgsql\9.3 folder.
4. Select components to install and click the Next button
5. Select the database directory to store the data. Just leave it by default or choose your own and click the Next button.
6. Enter the password for postgres root user.
7. Enter the port(5432) for PostgreSQL. Make sure that no other applications are using this port. Leave it as default if you are unsure.
8. Choose the default locale used by the database and click the Next button.
9. Ready to install PostgreSQL. Click the Next button to start installing.
  The installation may take a few minutes to complete.
10. Click the Finish button to complete the PostgreSQL installation.

Configure postgreSQL with PHP In Windows
1. Open php.ini file located in C:\xampp\php.
2. Uncomment the following lines in php.ini

extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

3. Add the below code snippet to httpd.conf file located on C:\xampp\apache.

LoadFile "C:\xampp\php\libpq.dll"

4. Restart Apache.

Integrating phpPgAdmin to XAMPP – postgreSQL Database Administration tool
1. To download phpPgAdmin, go to the Github repository and clone the repository to C:\xampp\phppgadmin.
Or download the repository as a Zip,and extract the content to C:\xampp\phppgadmin.
2. In C:\xampp\phppgadmin\conf, rename the config.inc.php-dist file to config.inc.php
3. Edit the config.inc.php and replace all instances of the following with the values below

$conf['servers'][0]['host'] = 'localhost';
$conf['servers'][0]['pg_dump_path'] = 'C:\\xampp\\pgsql\\9.3\\bin\\pg_dump.exe';
$conf['servers'][0]['pg_dumpall_path'] = 'C:\\xampp\\pgsql\\9.3\\bin\\pg_dumpall.exe';
$conf['extra_login_security'] = false;

4. Edit XAMPP’s httpd-xampp.conf and add the below code.

Alias /phppgadmin "C:/xampp/phppgadmin/"
      <directory "C:/xampp/phppgadmin">
        AllowOverride AuthConfig
        Require all granted
      </directory>

5. Restart Apache
6. You should now be able to use phpPgAdmin when you visit
http://localhost/phppgadmin.

 



Warning! This site uses cookies
By continuing to browse the site, you are agreeing to our use of cookies. Read our terms and privacy policy