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

search for in the

Dónde realizar un ajuste de configuración> <El fichero de configuración
Last updated: Fri, 20 May 2011

view this page in

ficheros .user.ini

A partir de PHP 5.3.0, PHP incluye soporte para ficheros INI .tipo-htaccess a nivel de directorios. Estos ficheros solo los procesa la SAPI CGI/FastCGI. Esta funcionalidad deja obsoleta la extensión PECL htscanner. Si está usando Apache, use los ficheros .htaccess para lograr el mismo efecto.

Además del fichero php.ini princiapl, PHP escanea en busca de ficheros INI en cada directorio, empezando por el directorio del fichero PHP solicitado, y continuando hasta el documento raíz actual (tal y como está establecido en $_SERVER['DOCUMENT_ROOT']). En el caso de que el fichero PHP se encuentre fuera del documento raíz, sólo se escaneará su directorio.

En los ficheros INI .user.ini sólo se reconocerán los ajustes INI que tengan los modos PHP_INI_PERDIR y PHP_INI_USER.

Las dos nuevas directivas INI, user_ini.filename y user_ini.cache_ttl controlan el uso de los ficheros INI de usuarios.

user_ini.filename fija el nombre del fichero que PHP buscará en cada directorio; si se fija un string vacío, PHP directamente no realizará ninguna búsqueda. El nombre por omisión es .user.ini.

user_ini.cache_ttl controla con qué frecuencia se reescanean los ficheros INI de usuario. El valor por omisión es 300 segundos (5 minutos).



add a note add a note User Contributed Notes ficheros .user.ini
Dolphyn 27-Apr-2011 02: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 06-Jan-2011 06: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 14-Oct-2010 10: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