较低的php.ini是否替换了目录树中的上层php.ini?在.htaccess中激活是否必要? [英] Does a lower php.ini replace an upper php.ini in the directory tree ? Activation in .htaccess necessary ?

查看:59
本文介绍了较低的php.ini是否替换了目录树中的上层php.ini?在.htaccess中激活是否必要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,我可以通过在此目录中添加一个新的php.ini来覆盖整个目录树的某个分支的php设置




这是真的吗?


如果我在这个新的php.ini中分配一个新值,那么1(!)php变量就是全部

当我走向

目录树的根目录时,从下一个php.ini获取的其他php参数值?或者 - 否则 - 是PHP在这种情况下采用的默认内置值?


我是否必须做其他事情来激活这个新的php.ini(例如在

..htaccess文件)?

Lars

解决方案

问候,Lars Willich。

回复你在2007年10月27日星期六,13:18:44发来的消息,


据我所知我可以覆盖整个目录树的某个分支的php设置

LWby在这个目录中添加一个额外的新php.ini.


LWIs this真的吗?


AFAIK,它被删除了一些版本以避免不可预测的结果。


LWIf我在这个新的php.ini中只分配了一个新的值为1(!)php变量然后所有的

LWother php参数值取自下一个php.ini当我走向

LWthe目录树的根?或者 - 否则 - 是PHP在这种情况下采用的默认内置值?


默认,因为PHP只读取单个INI文件。


LW我是否必须做其他事情来激活这个新的php.ini(例如在

LW.htaccess文件中指定一些内容)?


Hm。如果你使用PHP作为web

脚本引擎,请告诉我你为什么要烦扰PHP.ini
安装PHP作为Apache模块并使用httpd.conf / .htaccess来控制这是'b $ b行为。

使用php-apache2handler.ini或php-apache2filter.ini(取决于你使用哪个SAPI

)创建默认环境。

-

真诚的你,AnrDaemon< an ******* @ freemail.ru>


Lars Willich写道:


据我所知,我可以覆盖整个目录的某个分支的php设置树$

在这个目录中增加一个新的php.ini.


这是真的吗?


如果我在这个新的php.ini中分配只有一个新值到1(!)php变量那么所有的

其他php参数值取自下一个php.ini当我走向根

目录树?或者 - 否则 - 是PHP在这种情况下采用的默认内置值?


我是否必须做其他事情来激活这个新的php.ini(例如在

.htaccess文件)?


Lars



不知道其他人但在除.htaccess外,您还可以在Apache虚拟主机条目中覆盖ini条目。


请参阅:

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


滚动到底部的例子...


Norm


AnrDaemon写道:


问候,Lars Willich。

回复你在2007年10月27日星期六,13:18发来的消息: 44,


据我所知,我可以覆盖整个目录树的某个分支的php设置

LWby添加一个额外的新php。一世ni在这个目录中。


LWI这是真的吗?


AFAIK,它被删除了一些版本以避免不可预测的结果。


LWIf我在这个新的php.ini中分配只有1(!)php变量的新值然后是从下一个php获取的所有

LWother php参数值。 ini当我走向

LW目录树的根源?或者 - 否则 - 是PHP在这种情况下采用的默认内置值?


默认,因为PHP只读取单个INI文件。


LW我是否必须做其他事情来激活这个新的php.ini(例如在

LW.htaccess文件中指定一些内容)?


Hm。如果你使用PHP作为web

脚本引擎,请告诉我你为什么要烦扰PHP.ini
安装PHP作为Apache模块并使用httpd.conf / .htaccess来控制这是'b $ b行为。

使用php-apache2handler.ini或php-apache2filter.ini(取决于你使用哪个SAPI

)创建默认环境。



我总是使用php.ini来设置基本命令。我将使用httpd.conf

修改特定命令的特定目录,但这就是全部。


这是愚蠢的在httpd.conf中加载所有配置内容。并且

更糟糕的是把它放进去.htaccess!


-

========== ========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


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

解决方案

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

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

LWIs this true ?

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

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

Default, because PHP read only single INI file.

LWDo 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 <an*******@freemail.ru>


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


AnrDaemon wrote:

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

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

LWIs this true ?

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

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

Default, because PHP read only single INI file.

LWDo 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.
js*******@attglobal.net
==================


这篇关于较低的php.ini是否替换了目录树中的上层php.ini?在.htaccess中激活是否必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆