How to connect PostgreSQL with XAMPP

This article will help you to install and Integrate PostgreSql with XAMPP for practicality use:

  1. Download the PostgreSQL installer from EnterpriseDB and follow the instruction.
  2. Assuming your XAMPP is located in D:\XAMPP; so better locate your PostgreSQL in the same folder, sample: D:\XAMPP\PostgreSQL\12.
  3. Uncomment below lines in php.ini (usually located in D:\XAMPP\php\php.ini):
    From:
    ;extension=pdo_pgsql
    ;extension=pgsql
    To:
    extension=pdo_pgsql
    extension=pgsql
  4. Stop and Start (Restart) your Apache module in XAMPP Control Panel:
  5. Try opening it with pgAdmin to make sure your PostgreSQL database is working:
  6. You are ready to use PostgreSQL with your PHP code.

Leave a comment