You may want to set include flags when compiling.... CPPFLAGS=-I/usr/local/pgsql/include (or something like that)You're php install isn't finding the postgresql libs it needs. When you do the ./configure --with-pgsql check the output of the config run, and you'll see something like:
checking for PostgreSQL support... no
J
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq