Re: PHP4 to PHP5 issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Myron Turner wrote:
> Christopher Weldon wrote:
>> You actually don't even have to run a second instance of Apache. From
>> what I've heard of other hosting companies doing, you can use the same
>> Apache installation and run PHP4 and PHP5 concurrently.

if you use CGI for one of them then yes - but not if you [want to] use the apache
module for both of them, this is due to symbol clashes between php4 and php5 modules
when they are loaded simultaneously.

please correct me if I have the wrong end of the stick.

>>
>> However, the only thing you'd have to do is one of the following:
>>
>> 1) For PHP4 apps and scripts, leave the .php extension and rename all
>> PHP5 apps and scripts with a .php5 extension. Where you have the string:
>>
>> DirectoryIndex index.php index.html
>>
>> add: index.php5 to it. And where you have the string:
>>
>> AddType application/x-httpd-php .php
>>
>> Change it to:
>>
>> AddType application/x-httpd-php4 .php
>>
>> Also, add another line:
>>
>> AddType application/x-httpd-php5 .php5
>>
>> Make sure you include both the php4 and php5 modules, restart apache
>> and voila! PHP4 and PHP5 on the same server using 1 installation of
>> Apache.
>>
>> 2) Do the same as above, but use .php4 extensions instead of .php5.
>>
>> 3) Additionally, after doing 5 minutes of Googling, I found that you
>> can have .htaccess files to control which applications use PHP4 and
>> which use PHP5 with the following directive:
>>
>> AddHandler application/x-httpd-php5 .php
>>
>> This would circumvent having to rename the extensions of your PHP
>> files, as you could then do directory specific PHP4/5 app running. You
>> still have to make certain Apache has both the PHP4 and PHP5 modules
>> loaded, obviously.
>> -- 
> This has come up a few times recently, and I added my own two cents,
> which required two separate Apaches installs on the same server, which
> I'd done for myself.  But this solution is really cool!
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux