I posting this question as answers in previews posts didn't help me. i am trying to connect to DB postgres which is located on remote server from my local computer. I am using Xampp and Netbeans IDE.
below is the code i am trying to run :
//attempt a connection
$dbh = pg_connect("host=server_name port=5432 dbname=prototype1 user=leonidz password=****");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
This is the error msg:
Fatal error: Call to undefined function pg_connect() in C:\xampp\htdocs\PhpProject1\index.php on line 10
in php.ini I uncommitted: extension=php_pgsql.dll and extension=php_pdo_pgsql.dll
i also mapped the extension_dir = "C:\xampp\php\ext\" and restarted the Apache server after the change.
I don't know what else i should do, please help.
In the C:\xampp\php\php.ini , uncomment these:
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
After Done this Need to restart your xampp
In php.ini you need to uncomment
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
AND
extension="pgsql.so"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With