Fatal error: Call to undefined function pg_connect()

You need to install the php-pgsql package or whatever it's called for your platform. Which I don't think you said by the way.

On Ubuntu and Debian:

sudo apt-get install php5-pgsql

Easy install for ubuntu:

Just run:

sudo apt-get install php5-pgsql

then

sudo service apache2 restart //restart apache

or

Uncomment the following in php.ini by removing the ;

;extension=php_pgsql.dll

then restart apache


Fatal error: Call to undefined function pg_connect()...

I had this error when I was installing Lampp or xampp in Archlinux,

The solution was edit the php.ini, it is located in /opt/lampp/etc/php.ini

then find this line and uncomment

extension="pgsql.so"

then restart the server apache with xampp and test...