Jump to content

Running PHP4 & PHP5 side by side


Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/145159-running-php4-php5-side-by-side/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.