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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.