Call to undefined function pg_pconnect ()

2

I need to create a connection with a (already existing) database in PostgreSQL (Installed and working), using this code (which already existed already).

File access_bd.php

<?php
    function conecta() {
        $ip = $_SERVER['SERVER_ADDR'];
        $acesso = "host=127.0.0.1 dbname=meubanco user=meuuser password=minhasenha port=5432";
        $bd = pg_pconnect($acesso);
        return $bd;
    }

In my file index.php I call this file and together the method conecta , it shows the message Fatal error: Call to undefined function pg_pconnect() .

Performed Procedures

I accessed php.ini (from the PHP folder) and commented out the line extension= php_pgsql.dll , I also noticed that the file php_pgsql.dll is in the folder referenced ppelo extension_dir - extension_dir = "c:/wamp/bin/php/php5.5.12/ext/" . I copied the file php_pgsql.dll to the apache\bin folder. A

Change httpd.conf

Added the line as indicated by Anthony Accioly.     LoadFile "C: / Program Files / PostgreSQL / 9.3 / bin / libpq.dll"

Error Message

index.php

Warning: pg_connect(): in C:\wamp\www\testebd\acesso_bd.php on line 8
Call Stack
#   Time    Memory  Function    Location
1   0.0000  237520  {main}( )   ..\index.php:0
2   0.0010  241064  conecta( )  ..\index.php:3
3   0.0010  241248  pg_connect ( )  ..\acesso_bd.php:8

This acesso_bd.php:8 is $bd = pg_pconnect($acesso); and index.php:3 is $dadosConexao = conecta(); .

phpinfo ()

pdo_pgsql

PDO Driver for PostgreSQL   enabled
PostgreSQL(libpq) Version   9.2.2
Module version  1.0.2
Revision    $Id$

pgsql

PostgreSQL Support |enabled
PostgreSQL(libpq) Version   9.2.2
PostgreSQL(libpq)   Uninitialized version string (win32)
Multibyte character support enabled
SSL support disabled
Active Persistent Links 0
Active Links    0

Directive |Local Value | Master Value
pgsql.allow_persistent  On  On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice    Off Off
pgsql.max_links Unlimited   Unlimited
pgsql.max_persistent    Unlimited   Unlimited
    
asked by anonymous 26.09.2014 / 17:05

1 answer

1

I talked to the person who gave me the code, go and find out, but they changed the door to: port=5433

    
29.09.2014 / 13:54