On my dev server, I was able to install PHP5 as an apache module, then build PHP4.4.4 from scratch and enable it as a CGI. Now what do I do? :o
By default PHP handles files ending in .php and files ending in .php3 and .php4 are handled by PHP4 via cgi.
Do I tell hosting customers to create an .htaccess script and use mod-rewrite for their web folders with apps that only work in php4?
Or do is a sed command or something like that to recursively change all the file extensions and references to .php throughout the site folder to .php4?
To answer my own question- and in case anyone else wants to work this way, the .htaccess file should read:
Options + FollowSymlinks
Action php-script /cgi-bin/php
Customers just need to place that .htaccess file in whatever folder they want php4 to be used instead of the default handler for the server, which is the php5 module.
I also created a php4.conf in /etc/httpd/conf.d stipulates if .php4 and .php3 extensions are used, PHP4 is the handler.
You can put this .htaccess file in a /mysite/php4app and it applies to the that folder and all it’s sub-folders- but items in the root folder and other sub-folders of your site still uses php5.