Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I inastall php 5.4, apache and postgresql 9.2 on Windows 7 OS.

Now, I am trying connect to postgresql DB from php file, this is php connect code:

$dbconn = pg_connect("host=localhost dbname=postgres user=postgres password=pass");

This gives: Call to undefined function pg_connect()

In php.ini file I have: extension="path\to\extension\php_pgsql.dll"

What may causes this error?

share|improve this question
1  
Anything useful at stackoverflow.com/questions/7438059/… ? –  bma Jul 7 '13 at 20:57
    
I have extension="path\to\extension\php_pgsql.dll in php.ini file. This extension exists on specified path. After restarting apache webserver, I see phpinfo() and there is not info about pgsql. What I must do also? I am missing something? –  OTARIKI Jul 7 '13 at 21:12
    
libpq.dll and other dependencies must be in the PATH of apache's environment. –  Daniel Vérité Jul 7 '13 at 21:21
    
Is the php.ini file you are talking about is the one loaded by PHP ? You can see that on the phpinfo() page. –  greg Jul 9 '13 at 16:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.