I found it easy to upgrade my Mandrake 7.1 system to PHP4. You don't need to compile modules directly into Apache, as it also supports dynamic modules.
I followed instructions in the INSTALL file that comes with PHP4. Note that the INSTALL file covers more than one type of installation -- the one you're interested in is covered under the section "VERBOSE INSTALL" paragraph 2a (and continuing).
What happens is that PHP compiles a shared library that is installed in Apache's private library directory. On a Mandrake installation that is /usr/lib/apache/. The PHP4 shared library is called libphp4.so.
The PHP4 installation script modifies httpd.conf to tell Apache that it's necessary to load the shared library, and to define the proper file types (.php, .php3, .phps, .phtml) as associated with the PHP module.
On my system I had to edit /etc/httpd/conf/httpd.conf manually to remove references to php3, which had been installed previously, and I also removed the library /usr/lib/apache/libphp3.so, since it was no longer needed.
When you're done. run "apachectl restart" and you're off and running.