Re: Apache handler with Multiple PHP versions

From: Date: Thu, 12 Jul 2007 11:41:16 +0000
Subject: Re: Apache handler with Multiple PHP versions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-30861@lists.php.net to get a copy of this message
On 7/12/07, chris# <chris#@codewarehouse.net> wrote:
On Thu, 12 Jul 2007 11:38:44 +0200, Tijnema <tijnema@gmail.com> wrote: Hello Richard, On 7/12/07, Richard Lynch <ceo@l-i-e.com> wrote:
On Wed, July 11, 2007 6:13 pm, Tijnema wrote:
On 7/12/07, Jani Taskinen <jani.taskinen@sci.fi> wrote:
A lot easier (and works already) is to install PHP as CGI/FastCGI (one version or all of them, one can be module of course) and define the required PHP version by the file suffix.. --Jani
Hello Jani: I know this is possible, and I believe it is possible in Apache too with some kind of hack? But this still doesn't solve a lot of problems, but will generate a lot more with portable code. Take a bulletin board for example, there are a lot of files inside a board, and when you want to install that on your host that has PHP5 for files with .php5, you need to rename a hell lot of files to .php5, AND change code inside the .php5 files to point to the renamed files.
No, you add a <Directory> config in httpd.conf or add to .htaccess a line like <Files ~.php> ForceType whatever/gets/you/to/php-5 </Files>
1) Did you ever see a shared host that has multiple versions configured like this? 2) This will end up to be confusing for the end user, as they will need to create the .htaccess file (as most users don't have write rights for httpd.conf) This is no more unusual that adding/eliminating directory access. Which is pretty common stuff for users on a hosting companies box. Extremely simple too. The hosting outfit will /surely/ indicate any changes they need to make to provide them with the /added/ functionality. Maybe even add an applet in the Cpanel for it.
My host hasn't a single .htaccess file ;) (Using DirectAdmin..)
Other problems: Getting 2 PHP modules to co-exist without tromping on each others' symbols is, I think, the show-stopper...
Both modules are different files, and only one will be dynamically loaded by dlopen(), that works fine right? or do I forget something? Yes, you are. All OS's handle loading differently. An experience I read about indicated that it works fine with the BSD family of OS's but not with (at least) Linux.
of course they do, I was only thinking about linux. I always thought that it was possible in Linux too, as the dlopen function is available, and should work like that.
It was possible to have PHP3 and PHP4 both as modules, I think, but that was an anomoly?
That was nice :)
You also would have to re-think what happens when a version is requested that isn't installed at all... You currently have it just run in the default version, I think, but is that really useful? If the code really NEEDS PHP 5, and the server doesn't have 5, only 4, running the code that needs 5 is probably not the right action...
Ermm... I think there would be no point providing an environment that accommodated both versions, if both versions didn't exist. Sort of moot, isn't it? I did, I think it should generate an error message, E_RECOVERABLE_ERROR maybe? And then the default PHP version should just give the code a try, just like it does when it is installed on a host that has the wrong PHP version installed. I don't think an error makes any difference. If both versions aren't available, an environment that accommodated both would not/should not even be a consideration. Right?
Well, If some script was written for PHP4, but abandoned, and people start using it on a host that has PHP5/6 installed, then it might run just fine on PHP5. It's worth trying I think. Regards, Tijnema

« previous php.internals (#30861) next »