Problem scenario
You are trying to use a .php script on the back end to connect to your PostgreSQL database. However, you get an error like this when you try to run it: 'PHP Fatal error: Call to undefined function pg_connect() in '
Solution
Install php5-pgsql. For Ubuntu you would run a command like this: sudo apt-get install php5-pgsql