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

search for in the

Où une directive de configuration peut être modifiée> <Le fichier de configuration
[edit] Last updated: Fri, 17 May 2013

view this page in

Fichiers .user.ini

Depuis PHP 5.3.0, PHP inclut le support des fichiers INI au style .htaccess sur une base par dossier. Ces fichiers sont analysés uniquement par le SAPI CGI/FastCGI. Cette fonctionnalité rend obsolète l'extension PECL htscanner. Si vous utilisez Apache, l'utilisation des fichiers .htaccess produit le même effet.

En plus du fichier php.ini principal, PHP analyse les fichiers INI contenus dans chaque dossier, en commençant par le dossier depuis lequel le fichier PHP courant est appelé, et parcourt les dossiers jusqu'au dossier racine courant (tel que défini par la variable $_SERVER['DOCUMENT_ROOT']). Dans le cas où le fichier PHP est hors de la racine web, seul son dossier est scanné.

Seules les configurations INI avec les modes PHP_INI_PERDIR et PHP_INI_USER seront reconnues dans les fichiers INI .user.ini-style.

Deux nouvelles directives INI, user_ini.filename et user_ini.cache_ttl contrôlent l'utilisation des fichiers INI définis par l'utilisateur.

user_ini.filename définit le nom du fichier cherché par PHP dans chaque dossier ; si cette directive est définie à une chaîne vide, PHP n'analysera rien du tout. Par défaut, vaut .user.ini.

user_ini.cache_ttl contrôle la durée entre 2 re-lectures des fichiers INI définis par l'utilisateur. Par défaut, vaut 300 secondes (5 minutes).



add a note add a note User Contributed Notes Fichiers .user.ini - [5 notes]
up
1
philsward at gmail dot com
1 month ago
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: http://www.php.net/manual/en/ini.list.php

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.
up
-1
interfaSys
2 years ago
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 :)
up
-1
showerheadsuk at hotmail dot com
2 years ago
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
up
-2
Dolphyn
2 years ago
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)"
up
-4
Dolphyn
1 year ago
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).

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