PHP.mk документација

Список на php.ini секции

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

ini.sections.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека ini.sections.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Список на php.ini секции

Референца за `ini.sections.php` со подобрена типографија и навигација.

ini.sections.php

Листа на php.ini sections

Оваа листа ги вклучува php.ini секција што можете да ја конфигурирате за вашиот PHP сетуп на основа на домаќин или патека. Овие секции се опционални.

Овие секции не влијаат директно на PHP. Тие се користат за групирање на други php.ini директиви заедно и за да дејствуваат на одреден домаќин или на одредена патека.

Овие секции се користат само во CGI/FastCGI режим и не можат да постават extension and zend_extension directives.

Секции
Име Променливо Дневник на промени
[HOST=] INI_SYSTEM    
[HOST=] INI_SYSTEM    

Еве кратко објаснување на директивите за конфигурација.

[HOST=<host>]

Оваа секција ви овозможува да дефинирате сет на php.ini директиви што ќе стапат на сила на именуваниот домаќин.

Пример #1 Активирај целосно известување за грешки на екран за dev. domain

[HOST=dev.site.com]
error_reporting = E_ALL
display_errors = On
[PATH=<path>]

Оваа секција ви овозможува да дефинирате сет на php.ini директиви што ќе стапат на сила кога скрипта се извршува од именуваната патека.

Пример #2 Додади скрипта за безбедност за заштитени области

[PATH=/home/site/public/secure]
auto_prepend_file=security.php

Белешки од корисници 8 белешки

јавно на grik dot net
пред 16 години
In [HOST=...] one should use only the 1st server name from the list of server names.

I.E. if you have 
server_name example.com, example2.com;
and will use www.example.com in a browser, 
use [HOST=example.com] in php.ini for both addresses.

PHP looks not at the HOST request header (as I expected), but at the SERVER_NAME parameter (which by default is the 1st from the list of names, no matter what the HOST is).
[PATH=]
пред 7 години
this HOST and PATH sections doesn't seems to work in php.ini under apache 2.4 with php-fpm 7.1.16 for directive php_value or php_admin_value open_basedir or include_path.
phpinfo() says "none" in master and local values.
robinhook на mail dot com
пред 15 години
If you have a system which uses separated PHP inis for loading extensions (Debian, Fedora and most other distributions do so), [PATH=] or [HOST=] will prevent loading extensions defined in those ini files (extension= and zend_extension=).

I had some headache, when I added a hosts.ini to /etc/php5/cgi/conf.d (Debians default), where I wanted to define some defaults for a host name. The manual says extension= and zend_extension= aren't allowed in [HOST=] and [PATH=] (see above). I figured out that you can easily fix that with adding [PHP] after your definitions.

For example hosts.ini:
[HOST=dev.example.com]
display_errors = on

[PHP]

this will change the section back to [PHP] where extension= and zend_extension= is allowed.
crash на lubyte dot de
пред 6 години
Note that you cannot usefully set syslog.* in [PATH=] (and probably [HOST=]) sections, since the syslogger is initialized only once per php-fpm worker process, and not per request.
[PATH=]
пред 7 години
Sorry for the note. I've read some bad tutorials.
The correct syntax is : directive = 'value'
not a thing like : php_value[directive] = "somevalue"
leo
пред 14 години
Just developed the probably first php.ini hack to add commands which will only be parsed before PHP 5.3 when using mod_php.

<?php

# Disable eAccelerator by default
eaccelerator.enable = 0

# Now, to prevent incompatibilities with Zend Optimizer+, we
# want to enable eAccelerator only in PHP 5.2 or lower.
[HOST=*]
eaccelerator.enable = 1

?>

What is happening here? In PHP 5.3, php.ini sections to set up PHP on a per host basis have been introduced:

http://www.php.net/manual/en/ini.sections.php

These sections only work in CGI/FastCGI mode, however there still seems to be a difference in how the php.ini file is parsed in PHP 5.2 and PHP 5.3 when using mod_php: PHP 5.3 ignores everything below the line [HOST=*], whereas PHP 5.2 does not.

In the above example, PHP 5.3 only reads "eaccelerator.enable = 0" and then stops at the invalid command [HOST=*]. However, PHP 5.2 seems to ignore the invalid command and parses the whole configuration file, ending up with "eaccelerator.enable = 1".
dasloch на absatzen dot de
пред 14 години
On Windows IIS 7 server I noticed that [PATH=] was not listened to. [HOST=] however worked.
z dot himdi на bita dot nl
пред 15 години
Adding PATH= applies only to the named path and does not include sub-directories, you have to add a PATH= value for each sub-directory.

Also some settings have no effect even though phpinfo recognises and displays the per-folder value as the 'local' value, and the default as the 'master' value.

'fastcgi.impersonate' always uses the master setting.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.