Actually this is very simple, follow the steps below carefully:
Get the latest Apache 1.3 package from http://www.apache.org/dist/
Unzip (ungzip) and unpack (untar) to The path specified by Apache, such as /usr/local/src/apache-1.3.
Edit PHP and run ./configure --with-apache=//apache-1.3 (path
Enter "make", after running, run "make install", copy the required files to the Apache directory.
Jump to the Apache path //apache-1.3/src and edit the Configuration file. Add the AddModule modules/php3/libphp3.a string at the end of the file
Run './Configure' and then 'make'.
Now, you have the httpd binary with PHP.
Note: You can also run Apache’s ./configure configuration file. Refer to the README.configure file in your Apache package. Also, take a look at the INSTALL file in the PHP suite.