Page 1 of 1

Running php4 or 5

Posted: Thu Aug 03, 2006 3:10 pm
by julian_lp
Just a small snippet which I'm using to test code in both php4 and php5. I'd love hearing another options...

place inside C:\Apache2\conf two files named
PHP4httpd.conf
PHP5httpd.conf

each of them containing apache configuation stuff made to load the correct PHP version/extensions.

then, write two .bat files as following

run_php_4.bat
------------------------------------------------
del c:\apache2\conf\httpd.conf
copy c:\apache2\conf\PHP4httpd.conf c:\apache2\conf\httpd.conf
Start c:\apache2\bin\apache.exe


run_php_5.bat
------------------------------------------------
del c:\apache2\conf\httpd.conf
copy c:\apache2\conf\PHP5httpd.conf c:\apache2\conf\httpd.conf
Start c:\apache2\bin\apache.exe

Posted: Thu Aug 03, 2006 3:16 pm
by feyd
  • Run one as module, the other as CGI. Both can exist in the same instance.
  • Run two instances of Apache at once on separate ports.

Posted: Thu Aug 03, 2006 3:18 pm
by julian_lp
feyd wrote: Run two instances of Apache at once on separate ports
:wink: