title: Call to undefined function pg_connect()
body: <p>I am running the latest version of PHP (currently 5.6.22) on OSX El Capitan and Apache server.</p>
  
  <p>I am trying to use PostgreSQL database and actually, yesterday already worked but after I haver overridden httpd.conf file with a default one (I guess this is the problem) I got this message:</p>
  
  <blockquote>
    <p>Call to undefined function pg_connect() in ...</p>
  </blockquote>
  
  <p>The thing is that I haven't changed php.ini file. If I run phpinfo(); I get etc/php.ini for a Configuration File. So I am positive that Apache choose the right php.ini file and that correct extensions are loaded:</p>
  
  <pre><code>extension=php_pdo_pgsql.dll
  extension=php_pdo_sqlite.dll
  </code></pre>
  
  <p>What can cause this error ? Also I have installed pgAdmin 3 and I can successfully run SQL queries on created database (which I have used yesterday for this site I am working on).</p>
  
  <p>EDIT:</p>
  
  <p>This is what I get in error_log file when I restart Apache server and try to run that specific page (which calls pg_connect):</p>
  
  <blockquote>
    <p>[Thu Jun 02 15:28:15.595496 2016] [mpm_prefork:notice] [pid 476]
    AH00169: caught SIGTERM, shutting down [Thu Jun 02 15:28:16.515774
    2016] [so:warn] [pid 670] AH01574: module php5_module is already
    loaded, skipping PHP Warning:  PHP Startup: Unable to load dynamic
    library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mysqli.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_mysqli.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_pgsql.dll'
    - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_pgsql.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll'
    - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pgsql.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_pgsql.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_soap.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_soap.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sockets.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sockets.dll,
    9): image not found in Unknown on line 0 PHP Warning:  PHP Startup:
    Unable to load dynamic library
    '/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sqlite3.dll' -
    dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/php_sqlite3.dll,
    9): image not found in Unknown on line 0 [Thu Jun 02 15:28:16.615703
    2016] [mpm_prefork:notice] [pid 670] AH00163: Apache/2.4.18 (Unix)
    PHP/5.5.31 configured -- resuming normal operations [Thu Jun 02
    15:28:16.615786 2016] [core:notice] [pid 670] AH00094: Command line:
    '/usr/sbin/httpd -D FOREGROUND' [Thu Jun 02 15:28:20.869683 2016]
    [:error] [pid 674] [client 127.0.0.1:49594] PHP Fatal error:  Call to
    undefined function pg_connect() in
    /Library/WebServer/Documents/site/database.php on line 10</p>
  </blockquote>