LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installing two versions of php in the same machine. (https://www.linuxquestions.org/questions/linux-software-2/installing-two-versions-of-php-in-the-same-machine-172477/)

aadaileh 04-20-2004 09:07 AM

Installing two versions of php in the same machine.
 
Hi there ...

We need to get two different applications running in the same server.
The problem that each application needs different version of php; applicationX runs with any php version under 4.3 and the applicationY runs with php version 4.3 and above.

My question is: How can I get the two applications running in the same machine without having two Apache servers installed in the system?

Thanks for help,

Ahmed

jcookeman 04-20-2004 09:34 AM

Can't you change the file extension and associate the different extensions with other modules?

iluvatar 04-20-2004 09:34 AM

never tried it but this should be something:

*install the php versions in different directories
*mess-up the php config files ;) (maybe, not sure...)
*bind different filename extensions to the different php modules in the apache mime config file, like .php3 and .php4 for the different apps... technically it's possible to bind every extension to the php interpreter (even .asp) ;)
*be sure the two apps use the correct file names so they use the correct php version

but isn't php 4.3 and newer compatible with the older versions?
note: maybe the php module won't load if there's another version already loaded, I don't know that...

greetz,
.-=~ iluvatar ~=-.

aadaileh 04-20-2004 10:18 AM

jcookeman & iluvatar ...

Thanx a lot for your fast response :))

Actually; what you've suggested was the first idea I discussed with our webmaster ... The problem was the huge amount of work needed to change the file extension in one of the two application from (*.php) to (*.php4) to assign it to special modle. Having in mind that we will need not only to rename scripts but also to open every script inside the application and rename every included script name ...

In case of having no any other solution we may stick to this one. But I would appreciate having a solution, which assign every application to a certain php version based on the location of this application inside the DocRoot; for example:

[ApplicationX]: /www/htdocs/applicationx
[ApplicationY]: /www/htdocs/applicationy

So, isn't possible to configure two different virtual servers where everyone is pointing to different directory in the docroot and -of course- where it assigns certain php version to all php scripts stand in this certain directory?

Hope to hear from you soon ...

Ahmed

iluvatar 04-20-2004 10:23 AM

the renaming can be done with one simple script ;) I saw it on this forum somewhere... I would try this setup, the renaming isn't that hard. All links inside the code can even be renamed with ONE command :D look at the 'sed' command man-page for how to do that, renaming the files themselves has to be done with a small script, but can't remember :rolleyes:

greetz,
.-=~ iluvatar ~=-.


All times are GMT -5. The time now is 10:52 AM.