.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 минут).

Коментарии

Автор:
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 :)
2011-01-06 00:12:24
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
If you have no idea what "PHP_INI_PERDIR" or "PHP_INI_USER" are or how they relate to setting a .user.ini file, take a look at the ini.list page: ini.list

Basically, anything in the "Changeable" column labeled as PHP_INI_SYSTEM can't be set in the .user.ini file (so quit trying).  It can ONLY be set at the main php.ini level.
2013-04-03 09:45:50
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
"If you are using Apache, use .htaccess files for the same effect."

To clarify, this applies only to Apache module mode. If you put php directives in .htaccess on an Apache CGI/FastCGI server, this will bomb the server out with a 500 error. Thus, you unfortunately cannot create a config which caters for both types of hosting, at least not in any straightforward way.
2014-07-25 23:48:59
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
Be aware that PECL htscanner doesn't work (yet) on PHP7.0.

'pecl install htscanner' throws an "zend_hash_update’ undeclared'" error.
2018-09-04 16:15:26
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
Автор:
Since the .user.ini is read from public directories, it's contents will be served to anyone requesting it and potientially show them sensitive configuration settings. 

Add these lines to your .htaccess to block requests to it : 
<Files ".user.ini"> 
    Require all denied
</Files>
2019-09-05 18:05:52
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
For those looking for an example... .user.ini should be formatted as a simple list of [KEY]=[VALUE]\n sets.  For example, a one-line .user.ini file that serves solely to change the max allowable upload file size to 5Mb is:

upload_max_filesize="5M"
2020-06-07 20:01:07
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html
Trap for young players, not that I’m such a young player myself.

The default setting for user_ini.cache_ttl is 300 seconds, which means that it refreshes every 5 minutes. If you are tweaking the settings in .user.ini, it could take up to 5 minutes before you see the results of your experimentation.

If you don’t have access to php.ini where you can change this setting, you will have to learn to be very patient.
2022-08-07 03:38:08
http://php5.kiev.ua/manual/ru/configuration.file.per-user.html

    Поддержать сайт на родительском проекте КГБ