PHP with Postgresql

If PHP is installed as part of XAMPP, it will work with MySQL/MariaDB with no additional change.  However, to work with a separately installed postgresql server, one must take some additional steps:

  1. Include PostgreSQL bin on windows path
  2. Remove the semicolon before the following lines from c:\<xampp install directory>\php\php.ini
    extension=php_pdo_pgsql.dll
    extension=php_pgsql.dll
    
  3. Both dlls are already in the <xampp install directory>\php\ext directory. No copying necessary from external source.
  4. Restart the Apache server.
  5. Goto localhost on the web browser.  Click on phpinfo.  One should see support for the PDO and PDO_PGSQL drivers enabled.
  6. As a good test for the connection, also a good admin tool, download phppgadmin. Unzipp it in the htdoc directory.  Invoke it through localhost/phppgadmin<version>.  It should show up and connect to Postgresql server (if it is running!)  I found this admin tool runs faster than Pgadmin.