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?
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 aboutpgsql
. What I must do also? I am missing something? – OTARIKI Jul 7 '13 at 21:12libpq.dll
and other dependencies must be in the PATH of apache's environment. – Daniel Vérité Jul 7 '13 at 21:21php.ini
file you are talking about is the one loaded by PHP ? You can see that on thephpinfo()
page. – greg Jul 9 '13 at 16:18