Re: Running two versions of PHP locally

From: Date: Fri, 19 May 2006 23:41:37 +0000
Subject: Re: Running two versions of PHP locally
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-236543@lists.php.net to get a copy of this message
Scott Hurring wrote:
You should be able to do that with PHP4 and PHP5. However, most people don't wnat to have to use "php5" and "php4" as file extensions but rather want to be able to say, "everything on blah.com use php5 and everything on foo.org use php4"... or even to specify differeing versions within a single host (on a per-directory basis)
I would think you could do this on a domain-by-domain basis by using the AddType directive for that domain's root directory. But you would need to associate different 'types' for php4 and php5. It looks like 'application/x-httpd-php' is the default type for php4. Does php5 have a different type? Is there a way to explicitly assign a new type to a module? To be more explicit: When installing php5, what do I need to do to make this configuration work: <VirtualHost *:80>
        ServerName myPhp4domain.com
        DocumentRoot /allmydomains/myPhp4domain
...
        <Directory "/allmydomains/myPhp4domain">
                AddType application/x-httpd-php .php
...
        </Directory>
</VirtualHost> <VirtualHost *:80>
        ServerName myPhp5domain.com
        DocumentRoot /allmydomains/myPhp5domain
...
        <Directory "/allmydomains/myPhp5domain">
                AddType <application type assigned to php5> .php
...
        </Directory>
</VirtualHost> If this is possible, it would be a much cleaner upgrade path than mixing a module and a cgi setup. After all, the goal is to be able to upgrade from php4 to php5, gradually, on a domain-by-domain or even page-by-page basis. Forcing a transition to cgi along with a transition to PHP5 compounds the complexity of the task. (I've never run under cgi, but it's my impression that module and cgi installations have some signifcantly different behaviors, not a transition that should be done without good reason.) After I started writing this Richard Lynch posted:
Are you all saying you can't do that with PHP4 and PHP5? Why not?
I think because the internal Apache/PHP hacks that made that possible in 3/4 are not as readily done in 4/5 Feel free to submit a patch, though if you think it can be done. :-)
If this can't be done, I would think it would be a major impediment to the adoption of PHP5 at existing PHP4 installations. Someone (probably more proficient at C than I am) should be doing a patch. --John
You can easily accomplish this by using PHP4 as a module and PHP5 as CGI (and i'm sure other ways as well, but ive only personally done it this way) It makes it very easy to selectively downgrade (or upgrade) depending on your needs without having to jump through file-naming hoops or proxy ports, etc... On 5/19/06, John Hicks <johnlist@gulfbridge.net> wrote:
Just a quick sanity check from a php4 user who's thinking of trying php5: With PHP3 and PHP4 (I thought) you could install both Apache modules and invoke them on a page by page basis based on the extension you assign them in Apache ( .php v. .php4 for example). Are you all saying you can't do that with PHP4 and PHP5? Why not? Thanks, ---J Richard Lynch wrote:
With Apache, find Rasmus' post regarding "Proxy PHP4 PHP5" in the archives of this very list. You're on your own with IIS. On Fri, May 19, 2006 11:07 am, Phillip S. Baker wrote:
Greetings Gents, I am interested in running two versions of of PHP. I want to see if I can get my boss to buy into migrating to PHP 5. I want to set it up locally. Locally I am running apache on a windows XP box with PHP 4. I would like I would like to be able to set up PHP 5 as well on the server and have some folders/virtual hosts set up in php 4 and others in php 5? Is this possible? How would I go about doing it? Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#236543) next »