Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30844 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62769 invoked by uid 1010); 12 Jul 2007 09:45:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62753 invoked from network); 12 Jul 2007 09:45:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2007 09:45:25 -0000 Authentication-Results: pb1.pair.com header.from=tijnema@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tijnema@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.246 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tijnema@gmail.com X-Host-Fingerprint: 209.85.132.246 an-out-0708.google.com Received: from [209.85.132.246] ([209.85.132.246:22332] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/07-09861-238F5964 for ; Thu, 12 Jul 2007 05:45:23 -0400 Received: by an-out-0708.google.com with SMTP id c18so17755anc for ; Thu, 12 Jul 2007 02:45:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZyYBGKP2bi1hxWbu3zALBjFzynwwHvxd6zA88Se1awtdoPewpCUb6J3C4eKEsXgvyu02YI6fqCJFdzeF3WfDTYss/CpWV+zS2ilCuZD8LBAJc9s56nlo8f7x1bYgJxbl65+la6FOGGwYrPJo/e3K8utkRehAuCyBTptxPeU6zww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=miv81ngR/5eT0SgxifNUqLZVPz1iqz8SwELC+wWEImv/mQ7cVhsUkBXJjntIFij1A9g/HcnWWOGU9TywaYKQhJ+UuosEVl4+vAPzkeTmTu/aUQypME/kKIB+pVrCa6Hwj3tCVqFRoKMO0stcAc5ajEXvj1pqTQRdOOnDSaRCJkw= Received: by 10.100.135.16 with SMTP id i16mr183548and.1184233520667; Thu, 12 Jul 2007 02:45:20 -0700 (PDT) Received: by 10.100.33.17 with HTTP; Thu, 12 Jul 2007 02:45:20 -0700 (PDT) Message-ID: Date: Thu, 12 Jul 2007 11:45:20 +0200 To: "Guilherme Blanco" Cc: jani.taskinen@iki.fi, "PHP Developers Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <469562DD.2030601@sci.fi> Subject: Re: [PHP-DEV] Apache handler with Multiple PHP versions From: tijnema@gmail.com (Tijnema) On 7/12/07, Guilherme Blanco wrote: > Hi Tijnema, > > I think here is something that might interest you: > > http://www.phpclasses.org/browse/package/3472.html > > > Regards, Hello Guilherme, This comes quite close to my idea, except that this does only uncomment specfic sections that are for specific versions. This means that as a coder, you still need to write all of those bypasses for specific versions. Regards, Tijnema > > On 7/11/07, Tijnema wrote: > > On 7/12/07, Jani Taskinen 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. > > > > Regards, > > > > Tijnema > > > > > > Tijnema kirjoitti: > > > > Hello developers, > > > > > > > > The thread about dropping support for PHP4 gave me a new idea, havi= ng > > > > multiple PHP versions to be loaded by the Apache2handler SAPI. > > > > > > > > The idea: > > > > I was thinking about something like the shebang(#!) line used in > > > > bash/perl/python and even PHP scripts. But this time not for the > > > > program to be executed, but for which PHP version to load. This cou= ld > > > > be used like this: > > > > > > > > for PHP4, and so it could be > > > > or > > > > for resp. PHP5 or PHP6. > > > > This way can scripts define which PHP version they require, as it i= s a > > > > normal comment line, other PHP version can simply ignore the line. > > > > > > > > The implementation: > > > > 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. I= f > > > > 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 versio= n > > > > and issue a warning. > > > > > > > > What needs to change: > > > > Currently, PHP is one big module for Apache, which will load a full > > > > PHP version at once. For this, we require a very small handler, tha= t > > > > will use dlopen() to load the appropriate version and continue with > > > > the execution of the PHP script. > > > > Some kind of mini parser is also required to read the very first li= ne > > > > of a PHP script, because that needs to be done before any PHP versi= on > > > > is loaded. And maybe also a parser for the php.ini file, as php.ini > > > > needs an extra option for the default PHP version to be loaded, and > > > > one or more settings for configuring the different PHP versions and > > > > their path to the library. > > > > > > > > Some extra ideas, not sure if they need to be implemented: > > > > * Support for sub versions of PHP, like this: > > > > > > > > > > > > * Support for multiple possible PHP versions, like this: > > > > > > > > Where the first one is the preferred one, which can also be combine= d > > > > with the first one of course, like this: > > > > > > > > * Support for <, > and && signs in the version, like this: > > > > 5.2 && PHP < 5.3 ?> > > > > So that any PHP version between 5.2 and 5.3 fits, but that 5.2 is t= he > > > > preferred one, if 5.3 should be the preferred one, it should be > > > > written like this: > > > > 5.2 ?> > > > > * Support for this in other handlers, like FastCGI, ISAPI, etc. > > > > > > > > > > > > It seems to be the perfect solution for shared hosting providers to > > > > me, as it will allow the user to select which PHP version he wants = to > > > > use, and shared hosts can just install all three versions of PHP an= d > > > > use the one they need for their admin panels etc. (One of the reaso= ns > > > > against upgrading to PHP5), and users can use another version. > > > > I don't know too much about PHP core, and nearly nothing about the > > > > apache2handler, so if it's not possible, please excuse me for wasti= ng > > > > your time. > > > > But, if it is possible, I will definitely go deeper inside the core > > > > and SAPI code to get it working. > > > > > > > > Now, the reason I'm sending this to the list is that I need to know= if > > > > *) it is possible? > > > > *) it is not yet done > > > > *) it is wanted > > > > *) it will have any negative effect on something? > > > > > > > > I'd like to hear all your comments and objections on this, and of > > > > course, if you have any question, feel free to ask. > > > > > > > > Regards, > > > > > > > > Tijnema > > > > > > > > > > > > > -- > > Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: guilhermeblanco@hotmail.com > URL: http://blog.bisna.com > S=E3o Carlos - SP/Brazil >