chronister Posted February 14, 2009 Share Posted February 14, 2009 Hello All, On my webhost (1&1 ) I can switch from php4 to php5 by adding this line to a .htaccess file. AddType x-mapp-php5 .php I am attempting to do this on my local development machine as well. I have searched google, and PHPFreaks and have not found any assistance in doing this.. The closest I got was an article to run PHP5 on a sub-dir, which I don't want. I actually want to run PHP5 by default and php4 using a .htaccess directive like above. Has anyone done this type of thing? I currently have PHP5 and Apache2.2 running without issue. Any help you folks can provide would be most appreciated. Thanks, nate Quote Link to comment https://forums.phpfreaks.com/topic/145159-running-php4-php5-side-by-side/ Share on other sites More sharing options...
corbin Posted February 14, 2009 Share Posted February 14, 2009 If your host has PHP5, and your local server has PHP5, why in the world would you want to use PHP4? Quote Link to comment https://forums.phpfreaks.com/topic/145159-running-php4-php5-side-by-side/#findComment-761889 Share on other sites More sharing options...
chronister Posted February 14, 2009 Author Share Posted February 14, 2009 If your host has PHP5, and your local server has PHP5, why in the world would you want to use PHP4? For testing purposes. I am finally delving into the world of OOP, and writing some classes. I understand that PHP5 offers much better OOP, however on one particular project I am working on I am writing it so that it can be used on PHP4 and PHP5 so I would like to test it on both locally with a single line change to the .htaccess file like 1&1 offers. I can switch between them in the time it takes me to add or delete that line. I know that PHP5 is the direction to go as it is finally being adopted "widespread", but I wish to have PHP4 and PHP5 together. It is also a learning experiment. I want to see if I can learn more about the intricate dance Apache & PHP do together. I may grab an extra hard drive I have and install an OS, and use that to play around with. I don't want to use my current *working* test box to experiment with as it is running a site my wife uses daily that I built for her that has address book, recipes db, movies db, library tracking db etc... I know it is an odd request, but I think it could be a neat (read geeky) learning experience. Nate Quote Link to comment https://forums.phpfreaks.com/topic/145159-running-php4-php5-side-by-side/#findComment-761897 Share on other sites More sharing options...
corbin Posted February 14, 2009 Share Posted February 14, 2009 The only way I know how to do it is to run 1 of the version in CGI mode, and 1 as a module. I'm sure a tutorial is on google for that. As for a better way to do it, I have no idea. Never wanted to run PHP4 ;p. Quote Link to comment https://forums.phpfreaks.com/topic/145159-running-php4-php5-side-by-side/#findComment-761901 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.