Hey all, i have websites hosted on 1and1 and the servers default to PHP 4 and if you want PHP 5 or 6 you add "AddType x-mapp-php5(or 6) .php" and it'll run the scripts as PHP 5 or 6.

There isn't alot of information out there about how such a system is setup, i've contact 1and1 support asking to talk to a tech but i've little hope they'll give me any info about how this work.

I have a ubuntu server in my basement running mysql/apache that i can use a dev box but half my apps are php4 and half are php5 currently the only way to work things is to uninstall one, and reinstall the other to get php4/5 use.

Does anyone have any idea how to setup "AddType x-mapp-php5 .php" capability so i don't have to keep uninstall/installing php over and over again?

link|improve this question
2  
Not sure I understand. Is your question about where to put the AddType directive? – Pekka Feb 1 '11 at 22:12
This question belongs on serverfault. – Unkwntech Feb 1 '11 at 22:13
@Unkn no it doesn't. meta.stackoverflow.com/questions/39063/… – Pekka Feb 1 '11 at 22:15
1  
@Pekka: mod_rewrite doesn't come into play here, it's just basic apache configuration, and to me also seems to belong on SF. – wimvds Feb 1 '11 at 22:19
1  
@iarp: Ok, let me rephrase what I said : there's no stable release of PHP6 yet... I wouldn't install that on any production system, but hey, that's just me (and keeping my sanity :p). About php4 not being in the repo's : roll your own package or just compile from source (php.net/releases), it doesn't change anything about the apache configuration (which is what you're asking for right?). – wimvds Feb 2 '11 at 8:46
show 4 more comments
feedback

migrated from stackoverflow.com Feb 2 '11 at 1:57

This question came from our site for professional and enthusiast programmers.

2 Answers

You have two options:

  1. Run different apache instances on different ports (or IPs), which load different mod_php modules.
  2. Run the alternate versions as php-cgi (ie: php5 is mod_php, and the other versions run as php-cgi)
link|improve this answer
feedback

Last I checked, mod_php4 and mod_php5 didn't play nice together in the same apache, but maybe the hosting provider has figured that out. If so, then they likely have patched them to register as handlers for x-mapp-php5 or x-mapp-php4.

I wouldn't worry too much about this at all. You REALLY should be worried about PHP4 and the fact that it has been past its EOL for well over 18 months now!

http://news.php.net/php.announce/72

Do you trust the 1and1 guys to keep a version of PHP that is so badly out of date secure?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.