Apache fails silently after installation of MapServer 6.2.0

If PostgreSQL is running on the same machine make sure it is listening on 0.0.0.0 or on 127.0.0.1, or on :: on port 5432. To check this, the following command should return something:

sudo netstat -tlnp|egrep ':5432'

If you have PostgreSQL running on a different machine, check that the hosts file is configured correctly and that the proper host is used in the PostgreSQL configuration of your PHP application