php deve essere compilato con l'opzione --with-pgsql[=DIR].
http://it.php.net/manual/it/ref.pgsql.php