If you need PHP4 on a CentOS5/RHEL5 server then you’ll find the RPMs linked below very handy. They install to /opt/php4 and can coexist with a default PHP 5 install.
The included conf.d/php4.conf file includes sample lines to run it as a CGI or as a module.
RPMs are here:
See this URL for details to add the yum repo: