Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31016 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34574 invoked by uid 1010); 17 Jul 2007 20:09:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34559 invoked from network); 17 Jul 2007 20:09:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2007 20:09:20 -0000 Authentication-Results: pb1.pair.com header.from=info@adaniels.nl; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=info@adaniels.nl; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain adaniels.nl from 82.94.236.173 cause and error) X-PHP-List-Original-Sender: info@adaniels.nl X-Host-Fingerprint: 82.94.236.173 loco.helderhosting.nl Linux 2.5 (sometimes 2.4) (4) Received: from [82.94.236.173] ([82.94.236.173:37198] helo=loco.helderhosting.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/D0-05050-DE12D964 for ; Tue, 17 Jul 2007 16:09:19 -0400 Received: from [192.168.2.13] (bas3-toronto01-1177778256.dsl.bell.ca [70.51.120.80]) by loco (Postfix) with ESMTP id F418410E02EB for ; Tue, 17 Jul 2007 22:09:14 +0200 (CEST) Message-ID: <469D21F8.9080300@adaniels.nl> Date: Tue, 17 Jul 2007 16:09:28 -0400 User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: internals@lists.php.net References: <469877B6.8010307@zend.com> <4698F557.40006@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Apache handler with Multiple PHP versions From: info@adaniels.nl (Arnold Daniels) Hi, Sorry for this late reaction, but I was away for a few days. We (as ISP) have solved this by running multiple instanced of Apache. This way you can switch the IP in DNS to switch between PHP versions. You only need 1 install of Apache and do not need to copy/move any files while switching. As hosting company you can't really ask your clients to change their scripts anyway. This way they can simply choose the PHP version in the control panel. I have written a short howto about this a while ago: http://blog.adaniels.nl/?p=13, (showing how well my blog is read). I have fine-tuned the method since than, this was more a test setup, so if you want to know more, please let me know. Best regards, Arnold Tijnema wrote: > On 7/14/07, Rasmus Lerdorf wrote: >> Tijnema wrote: >> > On 7/14/07, Stanislav Malyshev wrote: >> >> > The Apache2handler SAPI should be loaded first, and read the very >> >> > first line of the PHP script to determine if a version is specified >> >> > there. If not, the handler needs to load its default PHP >> version. If >> >> > it is specified, it should try to load that version, and if it >> >> > couldn't find or load that version, fall back to the default >> version >> >> > and issue a warning. >> >> >> >> This means the engines would have to init/shutdown on each request, >> >> which makes it as bad as CGI. >> > Is that really a big problem? >> >> If you care at all about performance, yes. > > Well, I do, because if I don't, it won't be accepted anywhere. > >> >> > And isn't that what Apache currently does? >> >> No, of course not. The whole point of the Apache module version of PHP >> is to keep PHP in memory across requests and only call the MINIT and >> MSHUTDOWN hooks on server startup and shutdown. > > Thank you for your very short manual on Apache Module. So, the only > way I can implement this (without the performance hit), is by loading > all PHP version at once at startup of apache, which will increase > startup time, but that shouldn't be a problem. A more worrysome thing > is the memory usage, I don't think that in the code is described how > much memory it takes to load and startup PHP, can you give an > estimate? > >> >> Not to sound too elitist here, and this is directed just at you >> personally, but if you are going to post to the internals list, you >> should have some notion of how PHP works internally. We don't mind >> people who don't work on the code posting here occasionally, but please >> keep in mind that it is our primary means of communicating amongst the >> people working on the code and lately it has gotten a bit hard to pick >> out the useful stuff from the chatter. >> >> -Rasmus >> > > Thank you for clarifying the intention of this list, as I had another > intention of it. So, I'll start studying (docs of) the code soon. I > think it would be the best to actually work with the core too, so I > think I'll just start to implement this idea while learning how > everything works. > > Tijnema >