You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Stefan Dürrenberger <sd...@pm7.ch> on 2010/10/15 23:03:41 UTC
[users@httpd] Different PHP Version for a VirtualHost
Hi all,
i posted this to a forum, but I think this is the better place to ask.
I have a client who needs hosting for an old CMS that still uses PHP
4.4.x. I know they will have to upgrade eventually, but I need to keep
the site up in the meantime.
I have managed to compile and install php 4.4.9 as cgi and I try to
configure Apache to use this version for the client's virtual host
only.
The problem is, it doesn't work. I'm able to configure apache to use my
php4-version for ".php4"-files, but not for ".php". It always uses the
default version. I tried using AddType and AddHandler and also to use
RemoveTYpe/RemoveHandler before. I tried moving various bits
to .htaccess instead, but it just won't work.
My simplified config looks like this:
<VirtualHost 12:34:56:78:80>
ServerName www.domain.com
DocumentRoot /home/user/public_html
ErrorLog /home/user/log/error.log
CustomLog /home/user/log/access.log combined
<Directory /home/user/public_html>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from All
</Directory>
DirectoryIndex index.html index.php
<directory "/var/www/php4">
AllowOverride None
Options +ExecCGI +FollowSymLinks
Order allow,deny
Allow from all
</directory>
ScriptAlias /php4cgi /var/www/php4
Action php4-cgi /php4cgi/php
AddType php4-cgi .php4 .php
</VirtualHost>
Any ideas what to try next? Or workarounds?
regards,
Stefan
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Stefan Dürrenberger <sd...@pm7.ch>.
Am Freitag, den 15.10.2010, 14:34 -0700 schrieb Dave Mansfield:
> I don't know the code - but it seems that using AddType will not
> necessarily *override* the existing MIME association at some higher
> precedence. Have you tried ForceType in an appropriate context with
> your php4-specific scripts? Something like:
>
> <FilesMatch "\.php$|\.php4$">
> ForceType php4-cgi
> </FilesMatch>
>
> -- D Mansfield
That's a very good idea, thank you. I'll try this later today.
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Stefan Dürrenberger <sd...@pm7.ch>.
Am Samstag, den 16.10.2010, 10:10 -0700 schrieb Néstor:
> And u restarted Apache?
Yes
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Néstor <ro...@gmail.com>.
And u restarted Apache?
On Oct 15, 2010 11:37 PM, "Stefan Dürrenberger" <sd...@pm7.ch> wrote:
Am Freitag, den 15.10.2010, 18:12 -0700 schrieb Néstor:
> See if you have a .htaccess and take a look at it, it might have
> default information
> in this f...
I removed all .htaccess files already :-)
---------------------------------------------------------------------
The official User-To-User s...
Re: [users@httpd] Different PHP Version for a VirtualHost
Posted by Stefan Dürrenberger <sd...@pm7.ch>.
Am Freitag, den 15.10.2010, 18:12 -0700 schrieb Néstor:
> See if you have a .htaccess and take a look at it, it might have
> default information
> in this file.
I removed all .htaccess files already :-)
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Néstor <ro...@gmail.com>.
See if you have a .htaccess and take a look at it, it might have default
information
in this file.
:-)
On Fri, Oct 15, 2010 at 2:34 PM, Dave Mansfield <dm...@sbcglobal.net>wrote:
>
>
> Stefan Dürrenberger wrote:
>
>> Am Freitag, den 15.10.2010, 15:06 -0600 schrieb Brian Hirt:
>>
>>
>>> Maybe you can run a different apache process with the version of PHP you
>>> need on a different port and use mod_rewrite/mod_proxy from the public
>>> apache?
>>>
>>>
>>
>> It would work, but it seems complicated. There should really be a way to
>> configure this in one apache instance. I'm confused why it does work
>> for .php4-extensions, but not .php. But thanks, if I can't resolve this,
>> it's a workaround to try.
>>
>>
>>
> I don't know the code - but it seems that using AddType will not
> necessarily *override* the existing MIME association at some higher
> precedence. Have you tried ForceType in an appropriate context with your
> php4-specific scripts? Something like:
>
> <FilesMatch "\.php$|\.php4$">
> ForceType php4-cgi
> </FilesMatch>
>
> -- D Mansfield
>
>
> ---------------------------------------------------------------------
> 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] Different PHP Version for a VirtualHost
Posted by Dave Mansfield <dm...@sbcglobal.net>.
Stefan Dürrenberger wrote:
> Am Freitag, den 15.10.2010, 15:06 -0600 schrieb Brian Hirt:
>
>> Maybe you can run a different apache process with the version of PHP you need on a different port and use mod_rewrite/mod_proxy from the public apache?
>>
>
> It would work, but it seems complicated. There should really be a way to
> configure this in one apache instance. I'm confused why it does work
> for .php4-extensions, but not .php. But thanks, if I can't resolve this,
> it's a workaround to try.
>
>
>
I don't know the code - but it seems that using AddType will not
necessarily *override* the existing MIME association at some higher
precedence. Have you tried ForceType in an appropriate context with
your php4-specific scripts? Something like:
<FilesMatch "\.php$|\.php4$">
ForceType php4-cgi
</FilesMatch>
-- D Mansfield
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Igor Galić <i....@brainsware.org>.
----- "Stefan Dürrenberger" <sd...@pm7.ch> wrote:
> Am Freitag, den 15.10.2010, 15:06 -0600 schrieb Brian Hirt:
> > Maybe you can run a different apache process with the version of PHP
> you need on a different port and use mod_rewrite/mod_proxy from the
> public apache?
>
> It would work, but it seems complicated. There should really be a way
> to
> configure this in one apache instance. I'm confused why it does work
> for .php4-extensions, but not .php. But thanks, if I can't resolve
> this,
> it's a workaround to try.
http://wiki.apache.org/httpd/ExtendingPrivilegeSeparation
i
--
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.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
Re: [users@httpd] Different PHP Version for a VirtualHost
Posted by Stefan Dürrenberger <sd...@pm7.ch>.
Am Freitag, den 15.10.2010, 15:06 -0600 schrieb Brian Hirt:
> Maybe you can run a different apache process with the version of PHP you need on a different port and use mod_rewrite/mod_proxy from the public apache?
It would work, but it seems complicated. There should really be a way to
configure this in one apache instance. I'm confused why it does work
for .php4-extensions, but not .php. But thanks, if I can't resolve this,
it's a workaround to try.
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Brian Hirt <bh...@me.com>.
On Oct 15, 2010, at 3:03 PM, Stefan Dürrenberger wrote:
> i posted this to a forum, but I think this is the better place to ask.
>
> I have a client who needs hosting for an old CMS that still uses PHP
> 4.4.x. I know they will have to upgrade eventually, but I need to keep
> the site up in the meantime.
>
> I have managed to compile and install php 4.4.9 as cgi and I try to
> configure Apache to use this version for the client's virtual host
> only.
>
Maybe you can run a different apache process with the version of PHP you need on a different port and use mod_rewrite/mod_proxy from the public apache?
---------------------------------------------------------------------
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] Different PHP Version for a VirtualHost
Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
> Action php4-cgi /php4cgi/php
> AddType php4-cgi .php4 .php
Action application/x-httpd-php4 /php4cgi/php
AddType application/x-httpd-php4 .php4 .php
Joost
---------------------------------------------------------------------
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