Testing apache1.3 and apache2 in parallel with PHP
Our web-hosting service is still on apache1.3, but we've decide it's
finally time to switch to apache2.
We would like to have both apache daemons running in parallel for a
while to test out the setup. I have apache1.3 still listening on port
80; apache2 listens on a different port for testing purposes.
Several users use PHP. By default, PHP is disabled. The user enables it
on a per-directory basis using php_flag engine on.
I understand php_flag is not supported in apache2, and thus it won't
serve content from any directory where that instruction is in the
.htaccess file. I haven't been able to figure out how to duplicate the
setup we have with apache2--namely, PHP disabled by default, by
overriden on a per-directory basis. I've tried php_value engine 1, but
that doesn't seem to work. In any event, I'm concerned anything I do to
make the htaccess files compatible with apache2 will break compatibility
with apache1.3, so I won't be able to have everything running in
parallel for testing.
Two questions:
(1) How do disable PHP globally but enable per-directory in .htaccess
for apache2?
(2) Any way to do #1 that will allow things to continue to work as
before in apache1.3?
Thanks in advance for any tips.
Adam
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 03:40 PM
Thomas Goirand
Testing apache1.3 and apache2 in parallel with PHP
Adam Kessel wrote:
> I understand php_flag is not supported in apache2,
It sure is!!!
> and thus it won't
> serve content from any directory where that instruction is in the
> .htaccess file.
I just recently fixed couples of site's setup by adding some php_flag
session.auto_start Off directives. IIRC for broken Joomla setup of some
customers after our migration. This was few days ago, running Lenny
(where only apache2 is available). So, 100%, it's supported.
> I haven't been able to figure out how to duplicate the
> setup we have with apache2--namely, PHP disabled by default, by
> overriden on a per-directory basis. I've tried php_value engine 1, but
> that doesn't seem to work.
AFAIR, there's no php_value, but php_admin_value instead.
> In any event, I'm concerned anything I do to
> make the htaccess files compatible with apache2 will break compatibility
> with apache1.3, so I won't be able to have everything running in
> parallel for testing.
With all the above being said, I'm not sure you could enable the php
engine in a .htaccess. That would need some testings, I guess.
Thomas
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 04:06 PM
Adam Kessel
Testing apache1.3 and apache2 in parallel with PHP
Thomas Goirand wrote, on 3/23/2009 12:40 PM:
I understand php_flag is not supported in apache2,
It sure is!!!
I was basing that on this:
"Note that php_flag does not work with Apache 2. Neither does on / off —
you must use 0 (off) or 1 (on)."
http://dan.drydog.com/apache2php.html
Not correct?
I haven't been able to figure out how to duplicate the
setup we have with apache2--namely, PHP disabled by default, by
overriden on a per-directory basis. I've tried php_value engine 1, but
that doesn't seem to work.
AFAIR, there's no php_value, but php_admin_value instead.
So it seems like the relevant command would actually be
php_admin_flag engine on
In any event, I'm concerned anything I do to
make the htaccess files compatible with apache2 will break compatibility
with apache1.3, so I won't be able to have everything running in
parallel for testing.
With all the above being said, I'm not sure you could enable the php
engine in a .htaccess. That would need some testings, I guess.
But I can't see any way to make that command work in htaccess (rather
than in the site config).
Adam
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 04:07 PM
Sebastian Rose
Testing apache1.3 and apache2 in parallel with PHP
Thomas Goirand <thomas@goirand.fr> writes:
> AFAIR, there's no php_value, but php_admin_value instead.
Yes
> With all the above being said, I'm not sure you could enable the php
> engine in a .htaccess. That would need some testings, I guess.
>From the apache2 docs:
AddHandler
Description: Maps the filename extensions to the specified handler
Syntax: AddHandler handler-name extension [extension] ...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 04:39 PM
Sebastian Rose
Testing apache1.3 and apache2 in parallel with PHP
Adam Kessel <ajkessel@debian.org> writes:
> Thomas Goirand wrote, on 3/23/2009 12:40 PM:
>>> I understand php_flag is not supported in apache2,
>> It sure is!!!
>
> I was basing that on this:
>
> "Note that php_flag does not work with Apache 2. Neither does on / off — you
> must use 0 (off) or 1 (on)."
> http://dan.drydog.com/apache2php.html
>
> Not correct?
Even with these settings, I still get this in error.log:
.htaccess: php_flag not allowed here
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 05:07 PM
Adam Kessel
Testing apache1.3 and apache2 in parallel with PHP
Sebastian Rose wrote, on 3/23/2009 2:08 PM:
Adam Kessel <ajkessel@debian.org> writes:
NOTE the `IfModule' has to look like this:
<IfModule mod_php5.c>
php_value zend.ze1_compatibility_mode 0
php_value upload_max_file_size 50M
php_value max_execution_time 800
php_value register_globals 0
</IfModule>
Even with these settings, I still get this in error.log:
.htaccess: php_flag not allowed here
Value of AllowOverride?
All
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 05:08 PM
Sebastian Rose
Testing apache1.3 and apache2 in parallel with PHP
Adam Kessel <ajkessel@debian.org> writes:
> Sebastian Rose wrote, on 3/23/2009 1:39 PM:
>> Adam Kessel <ajkessel@debian.org> writes:
>>
>>> Thomas Goirand wrote, on 3/23/2009 12:40 PM:
>>>>> I understand php_flag is not supported in apache2,
>>>> It sure is!!!
>>> I was basing that on this:
>>>
>>> "Note that php_flag does not work with Apache 2. Neither does on / off — you
>>> must use 0 (off) or 1 (on)."
>>> http://dan.drydog.com/apache2php.html
>>>
>>> Not correct?
>>
>> No. It works.
>>
>> NOTE the `IfModule' has to look like this:
>>
>> <IfModule mod_php5.c>
>> php_value zend.ze1_compatibility_mode 0
>> php_value upload_max_file_size 50M
>> php_value max_execution_time 800
>> php_value register_globals 0
>> </IfModule>
>
> Even with these settings, I still get this in error.log:
>
> .htaccess: php_flag not allowed here
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 05:10 PM
Thomas Goirand
Testing apache1.3 and apache2 in parallel with PHP
Adam Kessel wrote:
> Sebastian Rose wrote, on 3/23/2009 1:39 PM:
>> Adam Kessel <ajkessel@debian.org> writes:
>>
>>> Thomas Goirand wrote, on 3/23/2009 12:40 PM:
>>>>> I understand php_flag is not supported in apache2,
>>>> It sure is!!!
>>> I was basing that on this:
>>>
>>> "Note that php_flag does not work with Apache 2. Neither does on /
>>> off — you
>>> must use 0 (off) or 1 (on)."
>>> http://dan.drydog.com/apache2php.html
>>>
>>> Not correct?
>>
>> No. It works.
>>
>> NOTE the `IfModule' has to look like this:
>>
>> <IfModule mod_php5.c>
>> php_value zend.ze1_compatibility_mode 0
>> php_value upload_max_file_size 50M
>> php_value max_execution_time 800
>> php_value register_globals 0
>> </IfModule>
>
> Even with these settings, I still get this in error.log:
>
> .htaccess: php_flag not allowed here
First, you need to have a look at the AllowOverride directive of apache,
second, it seems that you are confusing php_flag and php_admin_value.
Are these 2 exactly the same? I don't think so. It's a kind of mess for
me to see all these:
I used to use only:
- php_admin_value (in my apache2.conf)
- php_flag (in my .htaccess)
Can anyone tell what's the truth about it? I'm puzzled now...
Thomas
--
To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
03-23-2009, 05:22 PM
Sebastian Rose
Testing apache1.3 and apache2 in parallel with PHP
Adam Kessel <ajkessel@debian.org> writes:
> Sebastian Rose wrote, on 3/23/2009 2:08 PM:
>> Adam Kessel <ajkessel@debian.org> writes:
>>>> NOTE the `IfModule' has to look like this:
>>>> <IfModule mod_php5.c>
>>>> php_value zend.ze1_compatibility_mode 0
>>>> php_value upload_max_file_size 50M
>>>> php_value max_execution_time 800
>>>> php_value register_globals 0
>>>> </IfModule>
>>> Even with these settings, I still get this in error.log:
>>> .htaccess: php_flag not allowed here
>> Value of AllowOverride?
>
> All
Hmmm - that's funny actually. I used this with apache2. There are
differences between Php4 and Php5 maybe. Not all values may be set this
way. Some of them have to be set in php.ini.