ini_set() change la valeur de l'option de configuration varname et lui donne la valeur de newvalue. ini_set() retourne FALSE en cas d'échec, et la valeur précédente en cas de succès. La valeur de l'option de configuration sera modifiée durant toute l'exécution du script et pour ce script spécifiquement. Elle reprendra sa valeur par défaut dès la fin du script.
Toutes les options disponibles ne peuvent pas être toutes modifiées avec ini_set(). Ci-dessous, vous trouverez une liste de toutes les options (disponibles en PHP 4.0.5-dev), et si elles peuvent être modifiées.
Tableau 1. Options de configuration
Nom | Par défaut | Modifiable |
---|---|---|
define_syslog_variables | "0" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
highlight.bg | HL_BG_COLOR | PHP_INI_ALL |
highlight.comment | HL_COMMENT_COLOR | PHP_INI_ALL |
highlight.default | HL_DEFAULT_COLOR | PHP_INI_ALL |
highlight.html | HL_HTML_COLOR | PHP_INI_ALL |
highlight.keyword | HL_KEYWORD_COLOR | PHP_INI_ALL |
highlight.string | HL_STRING_COLOR | PHP_INI_ALL |
allow_call_time_pass_reference | "1" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
asp_tags | "0" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
display_errors | "1" | PHP_INI_ALL |
display_startup_errors | "0" | PHP_INI_ALL |
enable_dl | "1" | PHP_INI_SYSTEM |
error_append_string | NULL | PHP_INI_ALL |
error_prepend_string | NULL | PHP_INI_ALL |
expose_php | "1" | PHP_INI_SYSTEM |
html_errors | "1" | PHP_INI_SYSTEM |
ignore_user_abort | "0" | PHP_INI_ALL |
implicit_flush | "0" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
log_errors | "0" | PHP_INI_ALL |
magic_quotes_gpc | "1" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
magic_quotes_runtime | "0" | PHP_INI_ALL |
magic_quotes_sybase | "0" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
output_buffering | "0" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
output_handler | NULL | PHP_INI_PERDIR|PHP_INI_SYSTEM |
register_argc_argv | "1" | PHP_INI_ALL |
register_globals | "1" | PHP_INI_ALL |
safe_mode | "0" | PHP_INI_SYSTEM |
short_open_tag | "1" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
sql.safe_mode | "0" | PHP_INI_SYSTEM |
track_errors | "0" | PHP_INI_ALL |
y2k_compliance | "0" | PHP_INI_ALL |
arg_separator | "&" | PHP_INI_ALL |
auto_append_file | NULL | PHP_INI_ALL |
auto_prepend_file | NULL | PHP_INI_ALL |
doc_root | NULL | PHP_INI_SYSTEM |
default_charset | SAPI_DEFAULT_CHARSET | PHP_INI_ALL |
default_mimetype | SAPI_DEFAULT_MIMETYPE | PHP_INI_ALL |
error_log | NULL | PHP_INI_ALL |
extension_dir | PHP_EXTENSION_DIR | PHP_INI_SYSTEM |
gpc_order | "GPC" | PHP_INI_ALL |
include_path | PHP_INCLUDE_PATH | PHP_INI_ALL |
max_execution_time | "30" | PHP_INI_ALL |
open_basedir | NULL | PHP_INI_SYSTEM |
safe_mode_exec_dir | "1" | PHP_INI_SYSTEM |
upload_max_filesize | "2M" | PHP_INI_ALL |
file_uploads | "1" | PHP_INI_ALL |
post_max_size | "8M" | PHP_INI_SYSTEM |
upload_tmp_dir | NULL | PHP_INI_SYSTEM |
user_dir | NULL | PHP_INI_SYSTEM |
variables_order | NULL | PHP_INI_ALL |
SMTP | "localhost" | PHP_INI_ALL |
browscap | NULL | PHP_INI_SYSTEM |
error_reporting | NULL | PHP_INI_ALL |
memory_limit | "8M" | PHP_INI_ALL |
precision | "14" | PHP_INI_ALL |
sendmail_from | NULL | PHP_INI_ALL |
sendmail_path | DEFAULT_SENDMAIL_PATH | PHP_INI_SYSTEM |
disable_functions | "" | PHP_INI_SYSTEM |
allow_url_fopen | "1" | PHP_INI_ALL |
Tableau 2. Définition des constantes PHP_INI_*
Constante | Valeur | Signification |
---|---|---|
PHP_INI_USER | 1 | La valeur peut être modifiée dans un script |
PHP_INI_PERDIR | 2 | La valeur peut être modifiée dans le fichier .htaccess |
PHP_INI_SYSTEM | 4 | La valeur peut être modifiée dans php.ini ou httpd.conf |
PHP_INI_ALL | 7 | La valeur peut être modifiée n'importe où |
Voir aussi ini_alter(), ini_get() et ini_restore()
Précédent | Sommaire | Suivant |
ini_restore | Niveau supérieur | phpcredits |