There are several different approaches.
You could upgrade RedHat to a current version, which ought to include PHP4.
You could find PHP4 RPMs to upgrade it using RPM. I'd avoid that because of the usual entanglement of undocumented RPM dependencies.
Or you could just avoid all of that by getting the PHP4 sources and compiling them yourself, following the directions in the PHP4 docs. Read the INSTALL file and follow the directions under "QUICK INSTALL (DSO)" or the verbose instructions for dynamic modules.
I recommend the compile-it-youself approach. Just make sure you have the Apache-dev RPM installed (which provides the apxs utility, needed by PHP to complete the installation).