Connection php to Postgresql database

Asked

Viewed 508 times

0

Problem when connecting to Postgresql database using PHP. When I run the function pg_conect(), the following error occurs

Fatal error: Call to undefined function pg_connect() 

already added the postgresql dll path to httpd

LoadFile "C:/Program Files/PostgreSQL/9.4/bin/libpq.dll"

and I also activated the php extensions in php.ini by removing the ; Extension=php_pgsql.dll

Whenever I run the code to check if the extension is active it resumes me error

echo extension_loaded('pgsql') ? 'Ok':'Erro';

I currently use wampserv with apache2.4.9 and php5.5.12. How can I resolve this error? Is it possible to resolve the change by changing the version, since making these changes I can’t? How do I get php to access pgsql? since my application is unable to find it ?

1 answer

0

The problem was the version referring to wamp and its tools, I uninstalled the version using 2.* and installed the most current version. performed the procedure again to enable pgsql by removing the ; from php.ini, and now he was able to find the extension and connect to Postgresql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.