First it is not a good idea to attempt installing binary rpm packages built for another distribution. Rebuilding from the soucre works fairly well, but toy may have to edit the spec file and/or install other packages some that also need to be built from source.
The rpmbuild command will build the binary rpm packages for installation. Review the output at the end, you should see something like (if successfully built) for example;
No need to un-install the older version just install the new php packages by typing something like; rpm -Fvh php*.rpm
You can verify with; rpm -qa 'php*'
As far as setting up php with apache review the manuals for RHEL 4, the best way to learn; http://www.redhat.com/docs/manuals/enterprise/