How to connect to postgre database using php in xampp?

Manish Goyal

Manish Goyal

@manish-r2Hoep Oct 22, 2024
I am facing problem in connecting to postgre database in xampp

when try to execute the following script

It is showing me an unexpected error ie undefined function pg_connect()

Here is the script

<?php
$conexion = pg_connect("host=localhost port=5432 password=*** user=postgres dbname=***") or die('Can't connect!!!: ' . pg_last_error());
?>

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Mar 12, 2011

    AHH
    26 view but no reply

    Anyway i got the solution ,

    For this you have to modify php.ini file that you can search in xampp folder