Install PostgreSQL in XAMPP on Windows and integrate phpPgAdmin

Installing postgreSQL

  1. Download the postgreSQL installer from EnterpriseDB. Download the postgreSQL 9.2 as you might face frequent logout issue.
  2. Run the installer and follow the on-screen instruction.
  3. Assuming XAMPP is located in C:\xampp; using the pgSQL installer, install postgreSQL in say C:\xampp\pgsql\9.2 folder.
  4. You may skip the Stack Builder section.
  5. You will be prompted to set a password for postgres root user.
  6. By now, pgSQL has been installed.

Getting postgreSQL to talk with PHP

  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. Restart Apache
  4. Done.

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.2\\bin\\pg_dump.exe';
    $conf['servers'][0]['pg_dumpall_path'] = 'C:\\xampp\\pgsql\\9.2\\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.

Have something to Add?

Loading Facebook Comments ...
Loading Disqus Comments ...