You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ge...@yahoo.com on 2007/10/10 18:50:23 UTC
[users@httpd] Supporting two PHP installations
Hi,
Is it possible to have php4 and php5 installed into
the same apache installation telling apache that
some files should be executed using php4 and some
others using php5 even if they all have the same
extension (.php)?
I'm thinking about 2 virtual hosts or applying some
directory rules or listening to different ports...
but not sure....
We'll use Windows 2000 + Apache 2.
Thanks ;-)
____________________________________________________________________________________
¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:
http://correo.yahoo.com.mx/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Supporting two PHP installations
Posted by j k <jo...@gmail.com>.
On 10/10/07, gerocoma-forophp@yahoo.com <ge...@yahoo.com> wrote:
>
> Hi,
>
> Is it possible to have php4 and php5 installed into
> the same apache installation telling apache that
> some files should be executed using php4 and some
> others using php5 even if they all have the same
> extension (.php)?
>
> I'm thinking about 2 virtual hosts or applying some
> directory rules or listening to different ports...
> but not sure....
>
> We'll use Windows 2000 + Apache 2.
>
> Thanks ;-)
>
>
I'm doing that on my home windows box which isn't exposed outside the local
network so it doesn't have the very latest versions of php but here's what I
did which works on my pc:
I put php4 in one directory and php5 in another you can see where in the
hhtp.conf excerpts below.
So it ends up with reading C:\WINNT\php.ini for php4 and K:\php-
5.2.0\ini\ctb\php.ini for php5
php4 is running as an apache moduke and php5 as CGI but you might well do it
the other way around.
As an aside be warned that PHP4 is reaching endof life 12/21/07 and has
numerous serious bugs present even in the latest version. These are fixed in
the latest version of PHP5 so don't plan on having php4 hanging around for
long.
OK here's the relevant sections in http.conf:
#LoadModule php5_module "K:\php-5.2.0\php5apache.dll"
LoadModule php4_module "K:\php-4.4.4-Win32\php4apache.dll"
...
#AddModule mod_php5.c
AddModule mod_php4.c
...
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName localhost
DocumentRoot "I:\Program Files\Apache Group\Apache\htdocs"
SetEnv PHPRC "K:/php-4.4.4-Win32"
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName ctb
DocumentRoot "I:/Program Files/Apache Group/Apache/htdocs/php5dir"
ServerAdmin webmaster@yourdomain.com
DirectoryIndex index.php index.html index.htm
SetEnv PHPRC K:/php-5.2.0/ini/ctb
# you need this next line to make the action line below work
ScriptAlias /php/ "K:/php-5.2.0/"
AddHandler php5-script .php .html
Action php5-script "/php/php-cgi.exe"
ErrorLog logs/error.cttb.log
CustomLog logs/access.cttb.log combined
</VirtualHost>
-------------------
and in my hosts file
127.0.0.1 localhost
127.0.0.1 ctb
so that I can access each so:
for PHP4
http://localhost/
for PHP5
http://ctb/
Hope this helps.
Re: [users@httpd] Supporting two PHP installations
Posted by "Matthew A. Bockol" <mb...@carleton.edu>.
Hi,
There are two ways I know how to do this:
1) Install both the php4 and 5 libraries, but have two httpd.conf files and start two instances of apache+children, one with each. You'll need two IP addresses OR two different ports on the same IP address, though, so it's not the same as a namevirtualhost.
2) Install php4 *or* 5 libraries, set aside a directory that will not automatically process .php files, and make sure to include a #!c:/path/to/other/php (or similar, I'd do this under linux so I'm not sure of the Win32 convention) at the top of the scripts placed there.
Matt
----- Original Message -----
From: gerocoma-forophp@yahoo.com
To: users@httpd.apache.org
Sent: Wednesday, October 10, 2007 11:50:23 AM (GMT-0600) America/Chicago
Subject: [users@httpd] Supporting two PHP installations
Hi,
Is it possible to have php4 and php5 installed into
the same apache installation telling apache that
some files should be executed using php4 and some
others using php5 even if they all have the same
extension (.php)?
I'm thinking about 2 virtual hosts or applying some
directory rules or listening to different ports...
but not sure....
We'll use Windows 2000 + Apache 2.
Thanks ;-)
____________________________________________________________________________________
¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:
http://correo.yahoo.com.mx/
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org