f



Does a lower php.ini replace an upper php.ini in the directory tree ? Activation in .htaccess necessary ?

As far as I know I can override the php settings for a certain branch of the whole directory tree
by putting a additional, new php.ini in this directory.

Is this true ?

If I assign in this new php.ini only a new value to 1 (!) php variable are then all the
other php parameter values taken from the next php.ini when I go towards the root of
the directory tree? Or - otherwise - are default built-in values from PHP taken in this case ?

Do I have to do something else to activate this new php.ini (e.g. specify something in the
..htaccess file) ?

Lars

0
LarsWill (7)
10/27/2007 9:18:44 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

13 Replies
4705 Views

Similar Articles

[PageSpeed] 36

Greetings, Lars Willich.
In reply to Your message dated Saturday, October 27, 2007, 13:18:44,

LW> As far as I know I can override the php settings for a certain branch of the whole directory tree
LW> by putting a additional, new php.ini in this directory.

LW> Is this true ?

AFAIK, it was removed some builds ago to avoid unpredictable results.

LW> If I assign in this new php.ini only a new value to 1 (!) php variable are then all the
LW> other php parameter values taken from the next php.ini when I go towards the root of
LW> the directory tree? Or - otherwise - are default built-in values from PHP taken in this case ?

Default, because PHP read only single INI file.

LW> Do I have to do something else to activate this new php.ini (e.g. specify something in the
LW> .htaccess file) ?

Hm. Please tell me why You bothering with PHP.ini if You using PHP as web
scripting engine?
Install PHP as Apache module and use httpd.conf/.htaccess to control it's
behaviour.
Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
use) to create default environment.


-- 
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

0
anrdaemon (327)
10/27/2007 9:51:15 AM
Lars Willich wrote:
> As far as I know I can override the php settings for a certain branch of the whole directory tree
> by putting a additional, new php.ini in this directory.
> 
> Is this true ?
> 
> If I assign in this new php.ini only a new value to 1 (!) php variable are then all the
> other php parameter values taken from the next php.ini when I go towards the root of
> the directory tree? Or - otherwise - are default built-in values from PHP taken in this case ?
> 
> Do I have to do something else to activate this new php.ini (e.g. specify something in the
> .htaccess file) ?
> 
> Lars
> 

   DOn't know about others but in addition to .htaccess you can 
over-ride  ini entries within Apache virtual-host entries.

See:

http://us3.php.net/manual/en/ini.php

scroll to bottom for examples...

Norm
0
npeelman (606)
10/27/2007 1:18:17 PM
AnrDaemon wrote:
> Greetings, Lars Willich.
> In reply to Your message dated Saturday, October 27, 2007, 13:18:44,
> 
> LW> As far as I know I can override the php settings for a certain branch of the whole directory tree
> LW> by putting a additional, new php.ini in this directory.
> 
> LW> Is this true ?
> 
> AFAIK, it was removed some builds ago to avoid unpredictable results.
> 
> LW> If I assign in this new php.ini only a new value to 1 (!) php variable are then all the
> LW> other php parameter values taken from the next php.ini when I go towards the root of
> LW> the directory tree? Or - otherwise - are default built-in values from PHP taken in this case ?
> 
> Default, because PHP read only single INI file.
> 
> LW> Do I have to do something else to activate this new php.ini (e.g. specify something in the
> LW> .htaccess file) ?
> 
> Hm. Please tell me why You bothering with PHP.ini if You using PHP as web
> scripting engine?
> Install PHP as Apache module and use httpd.conf/.htaccess to control it's
> behaviour.
> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
> use) to create default environment.
> 
> 

I always use php.ini to set the basic commands.  I'll use the httpd.conf 
to modify specific directories for specific commands, but that's all.

It's stupid to load all of your configuration stuff in httpd.conf.  And 
even worse to put it in .htaccess!

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/27/2007 2:15:16 PM
Greetings, Jerry Stuckle.
In reply to Your message dated Saturday, October 27, 2007, 18:15:16,

> I always use php.ini to set the basic commands.  I'll use the httpd.conf
> to modify specific directories for specific commands, but that's all.

> It's stupid to load all of your configuration stuff in httpd.conf.  And 
> even worse to put it in .htaccess!

We're speaking about specific needs (say, handling dynamic signatures and file
downloads).

Why I said

>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>> use) to create default environment.


-- 
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

0
anrdaemon (327)
10/27/2007 2:46:52 PM
AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Saturday, October 27, 2007, 18:15:16,
> 
>> I always use php.ini to set the basic commands.  I'll use the httpd.conf
>> to modify specific directories for specific commands, but that's all.
> 
>> It's stupid to load all of your configuration stuff in httpd.conf.  And 
>> even worse to put it in .htaccess!
> 
> We're speaking about specific needs (say, handling dynamic signatures and file
> downloads).
> 
> Why I said
> 
>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>> use) to create default environment.
> 
> 

Try your full comment:

 >>> Hm. Please tell me why You bothering with PHP.ini if You using PHP
 >>> as web scripting engine?
 >>>
 >>> Install PHP as Apache module and use httpd.conf/.htaccess to control
 >>> it's behaviour.
 >>>
 >>> Use php-apache2handler.ini or php-apache2filter.ini (depends on
 >>> which SAPI You use) to create default environment.

I restate.  It is stupid to place everything in your httpd.conf, 
directly or indirectly by placing it in a file called in your 
httpd.conf.  PHP.INI is the initialization file for PHP, and should be 
used as such.

Everything in the world does not belong in your httpd.conf, directly or 
indirectly.  It is the Apache configuration file, not the PHP, Perl, 
MySQL and the rest-of-the-world configuration file. It should be used as 
such - for configuring Apache and things which are specific to the 
server, a virtual host or a directory.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/27/2007 3:02:01 PM
Greetings, Jerry Stuckle.
In reply to Your message dated Saturday, October 27, 2007, 18:02:01,

> AnrDaemon wrote:
>> Greetings, Jerry Stuckle.
>> In reply to Your message dated Saturday, October 27, 2007, 18:15:16,
>> 
>>> I always use php.ini to set the basic commands.  I'll use the httpd.conf
>>> to modify specific directories for specific commands, but that's all.
>> 
>>> It's stupid to load all of your configuration stuff in httpd.conf.  And 
>>> even worse to put it in .htaccess!
>> 
>> We're speaking about specific needs (say, handling dynamic signatures and file
>> downloads).
>> 
>> Why I said
>> 
>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>> use) to create default environment.
>> 
>> 

> Try your full comment:

>  >>> Hm. Please tell me why You bothering with PHP.ini if You using PHP
>  >>> as web scripting engine?
>  >>>
>  >>> Install PHP as Apache module and use httpd.conf/.htaccess to control
>  >>> it's behaviour.
>  >>>
>  >>> Use php-apache2handler.ini or php-apache2filter.ini (depends on
>  >>> which SAPI You use) to create default environment.

> I restate.  It is stupid to place everything in your httpd.conf,

You're indeed right. Any better comments?

> directly or indirectly by placing it in a file called in your 
> httpd.conf.  PHP.INI is the initialization file for PHP, and should be 
> used as such.

Well, please, how I can change PHP/Apache behaviour in single directory using
one PHP.ini?

> Everything in the world does not belong in your httpd.conf, directly or 
> indirectly.  It is the Apache configuration file, not the PHP, Perl, 
> MySQL and the rest-of-the-world configuration file. It should be used as 
> such - for configuring Apache and things which are specific to the 
> server, a virtual host or a directory.

Loading PHP as apache module making it in fact part of Apache, so I configure
Apache module from httpd.conf. What's wrong?
Or You just want a place to spread Your idealism? Sorry, I'm not a good
target for Your lessons.


-- 
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

0
anrdaemon (327)
10/29/2007 10:05:48 AM
On Oct 29, 11:05 am, AnrDaemon <anrdae...@freemail.ru> wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Saturday, October 27, 2007, 18:02:01,
>
>
>
> > AnrDaemon wrote:
> >> Greetings, Jerry Stuckle.
> >> In reply to Your message dated Saturday, October 27, 2007, 18:15:16,
>
> >>> I always use php.ini to set the basic commands.  I'll use the httpd.conf
> >>> to modify specific directories for specific commands, but that's all.
>
> >>> It's stupid to load all of your configuration stuff in httpd.conf.  And
> >>> even worse to put it in .htaccess!
>
> >> We're speaking about specific needs (say, handling dynamic signatures and file
> >> downloads).
>
> >> Why I said
>
> >>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
> >>>> use) to create default environment.
>
> > Try your full comment:
> >  >>> Hm. Please tell me why You bothering with PHP.ini if You using PHP
> >  >>> as web scripting engine?
>
> >  >>> Install PHP as Apache module and use httpd.conf/.htaccess to control
> >  >>> it's behaviour.
>
> >  >>> Use php-apache2handler.ini or php-apache2filter.ini (depends on
> >  >>> which SAPI You use) to create default environment.
> > I restate.  It is stupid to place everything in your httpd.conf,
>
> You're indeed right. Any better comments?
>
> > directly or indirectly by placing it in a file called in your
> > httpd.conf.  PHP.INI is the initialization file for PHP, and should be
> > used as such.
>
> Well, please, how I can change PHP/Apache behaviour in single directory using
> one PHP.ini?

As he states:

> > It (httpd.conf) should be used as
> > such - for configuring Apache and things which are specific to the
> > server, a virtual host or a directory.

I suspect you actually agree...
--
Rik

0
10/29/2007 11:08:07 AM
AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Saturday, October 27, 2007, 18:02:01,
> 
>> AnrDaemon wrote:
>>> Greetings, Jerry Stuckle.
>>> In reply to Your message dated Saturday, October 27, 2007, 18:15:16,
>>>
>>>> I always use php.ini to set the basic commands.  I'll use the httpd.conf
>>>> to modify specific directories for specific commands, but that's all.
>>>> It's stupid to load all of your configuration stuff in httpd.conf.  And 
>>>> even worse to put it in .htaccess!
>>> We're speaking about specific needs (say, handling dynamic signatures and file
>>> downloads).
>>>
>>> Why I said
>>>
>>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>>> use) to create default environment.
>>>
> 
>> Try your full comment:
> 
>>  >>> Hm. Please tell me why You bothering with PHP.ini if You using PHP
>>  >>> as web scripting engine?
>>  >>>
>>  >>> Install PHP as Apache module and use httpd.conf/.htaccess to control
>>  >>> it's behaviour.
>>  >>>
>>  >>> Use php-apache2handler.ini or php-apache2filter.ini (depends on
>>  >>> which SAPI You use) to create default environment.
> 
>> I restate.  It is stupid to place everything in your httpd.conf,
> 
> You're indeed right. Any better comments?
> 
>> directly or indirectly by placing it in a file called in your 
>> httpd.conf.  PHP.INI is the initialization file for PHP, and should be 
>> used as such.
> 
> Well, please, how I can change PHP/Apache behaviour in single directory using
> one PHP.ini?
>

You should read EVERYTHING I said - and not take things out of context.

>> Everything in the world does not belong in your httpd.conf, directly or 
>> indirectly.  It is the Apache configuration file, not the PHP, Perl, 
>> MySQL and the rest-of-the-world configuration file. It should be used as 
>> such - for configuring Apache and things which are specific to the 
>> server, a virtual host or a directory.
> 
> Loading PHP as apache module making it in fact part of Apache, so I configure
> Apache module from httpd.conf. What's wrong?
> Or You just want a place to spread Your idealism? Sorry, I'm not a good
> target for Your lessons.
> 
> 

No, loading PHP as an apache module makes it an EXTENSION of Apache. 
You should configure Apache in httpd.conf and PHP in php.ini.  That's 
what they are there for.

Sorry, when I see someone post something this asinine, I'll call you on 
it.  Just because you're being an idiot doesn't mean the entire world 
should be.

Let's see you show me where ZEND or Apache recommend you do it this way.




-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/29/2007 11:22:09 AM
luiheidsgoeroe@hotmail.com wrote:
> On Oct 29, 11:05 am, AnrDaemon <anrdae...@freemail.ru> wrote:
>> Greetings, Jerry Stuckle.
>> In reply to Your message dated Saturday, October 27, 2007, 18:02:01,
>>
>>
>>
>>> AnrDaemon wrote:
>>>> Greetings, Jerry Stuckle.
>>>> In reply to Your message dated Saturday, October 27, 2007, 18:15:16,
>>>>> I always use php.ini to set the basic commands.  I'll use the httpd.conf
>>>>> to modify specific directories for specific commands, but that's all.
>>>>> It's stupid to load all of your configuration stuff in httpd.conf.  And
>>>>> even worse to put it in .htaccess!
>>>> We're speaking about specific needs (say, handling dynamic signatures and file
>>>> downloads).
>>>> Why I said
>>>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>>>> use) to create default environment.
>>> Try your full comment:
>>>  >>> Hm. Please tell me why You bothering with PHP.ini if You using PHP
>>>  >>> as web scripting engine?
>>>  >>> Install PHP as Apache module and use httpd.conf/.htaccess to control
>>>  >>> it's behaviour.
>>>  >>> Use php-apache2handler.ini or php-apache2filter.ini (depends on
>>>  >>> which SAPI You use) to create default environment.
>>> I restate.  It is stupid to place everything in your httpd.conf,
>> You're indeed right. Any better comments?
>>
>>> directly or indirectly by placing it in a file called in your
>>> httpd.conf.  PHP.INI is the initialization file for PHP, and should be
>>> used as such.
>> Well, please, how I can change PHP/Apache behaviour in single directory using
>> one PHP.ini?
> 
> As he states:
> 
>>> It (httpd.conf) should be used as
>>> such - for configuring Apache and things which are specific to the
>>> server, a virtual host or a directory.
> 
> I suspect you actually agree...
> --
> Rik
> 
> 

Hi, Rik,

No, he's saying he does ALL PHP configuration in his httpd.conf 
(actually a file included in his httpd.conf).  I'm saying PHP should be 
configured in the php.ini file and only modified in httpd.conf as necessary.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/29/2007 11:47:41 AM
Greetings, Jerry Stuckle.
In reply to Your message dated Monday, October 29, 2007, 14:47:41,

> No, he's saying he does ALL PHP configuration in his httpd.conf

Please don't tell me what You think I said.
And read *everything* I wrote. Not only what You want to read.

> (actually a file included in his httpd.conf).

You stupid. Sad but true.

> I'm saying PHP should be
> configured in the php.ini file and only modified in httpd.conf as necessary.

Again:

> Why I said

>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>> use) to create default environment.


-- 
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

0
anrdaemon (327)
10/30/2007 9:55:32 PM
AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Monday, October 29, 2007, 14:47:41,
> 
>> No, he's saying he does ALL PHP configuration in his httpd.conf
> 
> Please don't tell me what You think I said.
> And read *everything* I wrote. Not only what You want to read.
> 
>> (actually a file included in his httpd.conf).
> 
> You stupid. Sad but true.
> 
>> I'm saying PHP should be
>> configured in the php.ini file and only modified in httpd.conf as necessary.
> 
> Again:
> 
>> Why I said
> 
>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>> use) to create default environment.
> 
> 

Yes, I read everything you said.  You are including them in your 
httpd.conf file.

And I quote:

 > Install PHP as Apache module and use httpd.conf/.htaccess to control
 > it's behavior.

And it's still a stoopid way to do it.  You should not use 
httpd.conf/.htaccess to control PHP behavior except on a virtual machine 
or lower (i.e. directory, file) level.




-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/31/2007 1:02:59 AM
Greetings, Jerry Stuckle.
In reply to Your message dated Wednesday, October 31, 2007, 04:02:59,

> AnrDaemon wrote:
>> Greetings, Jerry Stuckle.
>> In reply to Your message dated Monday, October 29, 2007, 14:47:41,
>> 
>>> No, he's saying he does ALL PHP configuration in his httpd.conf
>> 
>> Please don't tell me what You think I said.
>> And read *everything* I wrote. Not only what You want to read.
>> 
>>> (actually a file included in his httpd.conf).
>> 
>> You stupid. Sad but true.
>> 
>>> I'm saying PHP should be
>>> configured in the php.ini file and only modified in httpd.conf as necessary.
>> 
>> Again:
>> 
>>> Why I said
>> 
>>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>>> use) to create default environment.

> Yes, I read everything you said.  You are including them in your 
> httpd.conf file.

Where you read it? Point please.


-- 
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

0
anrdaemon (327)
10/31/2007 1:23:46 PM
AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Wednesday, October 31, 2007, 04:02:59,
> 
>> AnrDaemon wrote:
>>> Greetings, Jerry Stuckle.
>>> In reply to Your message dated Monday, October 29, 2007, 14:47:41,
>>>
>>>> No, he's saying he does ALL PHP configuration in his httpd.conf
>>> Please don't tell me what You think I said.
>>> And read *everything* I wrote. Not only what You want to read.
>>>
>>>> (actually a file included in his httpd.conf).
>>> You stupid. Sad but true.
>>>
>>>> I'm saying PHP should be
>>>> configured in the php.ini file and only modified in httpd.conf as necessary.
>>> Again:
>>>
>>>> Why I said
>>>>>> Use php-apache2handler.ini or php-apache2filter.ini (depends on which SAPI You
>>>>>> use) to create default environment.
> 
>> Yes, I read everything you said.  You are including them in your 
>> httpd.conf file.
> 
> Where you read it? Point please.
> 
> 

Read what I quoted - instead of trimming my posts to not include it.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

0
jstucklex (14659)
10/31/2007 2:52:36 PM
Reply: