downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Где могут быть установлены параметры конфигурации> <Файл конфигурации
[edit] Last updated: Fri, 25 May 2012

view this page in

.user.ini files

С версии PHP 5.3.0 включена поддержка INI-файлов в стиле .htaccess на уровне каталога. Эти файлы обрабатываются только CGI/FastCGI SAPI. Эта функция исключает расширение PECL htscanner. Если у вас Apache, пользуйтесь .htaccess файлами для достижения того же эффекта.

В дополнение к основному файлуphp.ini , PHP ищет INI-файлы в каждой директории, начиная с директории запрошенного PHP-файла и продолжает поиск до корневой директории (установленной в $_SERVER['DOCUMENT_ROOT']). Если PHP-файл находится вне корневой директории, то сканируется только его директория.

Только INI-настройки с режимами PHP_INI_PERDIR и PHP_INI_USER будут распознаны в INI-файлах в стиле .user.ini.

Две новых INI-директивы, user_ini.filename и user_ini.cache_ttl контролируют использование пользовательских INI-файлов.

user_ini.filename устанавливает имя файла, по которому PHP производит поиск в каждой директории; если установлена пустая строка, то PHP поиск не производит. По умолчанию .user.ini.

user_ini.cache_ttl устанавливает насколько часто пользовательские INI-файлы будут обновляться. По умолчанию период обновления составляет 300 секунд (5 минут).



add a note add a note User Contributed Notes .user.ini files
Dolphyn 28-Apr-2012 12:48
Apparently the .user.ini file cannot be used to add dynamic extensions. For example, "extension=php_pdo_mysql.dll" has no effect in a .user.ini file (as of PHP 5.3.10 using FastCGI on IIS 6).
Dolphyn 27-Apr-2011 01:43
As of PHP 5..3.6, applicable .user.ini files are *not* listed or identified in phpinfo() output.

A .user.ini file can be in effect even when phpinfo() shows "additional .ini files parsed: (none)"
interfaSys 05-Jan-2011 03:12
This article should be made clearer.
".htaccess-style INI files" meant to me that the ini settings had to follow the syntax used in .htaccess, but this is not the case!

You have to use
register_globals=on
and not
php_flag register_globals on

Also, the changes can take a while to propagate to all processes if you have a long process time out.
Restarting php-fpm can give you an answer quicker :)
showerheadsuk at hotmail dot com 13-Oct-2010 09:18
Currently .user.ini files aren't read when using php-fpm, instead you can use [HOST] and [PATH] sections in your main php.ini to set per directory and per domain settings: http://us3.php.net/manual/en/ini.sections.php

 
show source | credits | stats | sitemap | contact | advertising | mirror sites