Are you using RPMs or source tar balls?
If you mix and match, it can be a little tough.
I just download all three (PHP,Apache,Postgresql) and build them like this:
Postgresql first:
cd /usr/local/src
tar xvzf /dir/to/tgz/postgresql-7.3.4.tar.gz
cd postgresql-7.3.4
./configure --with-maxbackends=256
make
make install
cd /etc
echo "/usr/local/pgsql/lib" >>ld.so.conf
ldconfig
cd /usr/local/src/
tar xvzf /dir/to/tgz/apache-1.3.28.tar.gz
cd apache-1.3.28
./configure --enable-module=most --enable-shared=max
make
make install
cd /usr/local/src/
tar xvzf /dir/to/tgz/php-4.3.2.tar.gz
cd php-4.3.2
./configure --with-pgsql
make
make install
then edit /use/local/apache/conf/httpd.conf and uncomment the addhandler line for php and you're set.