ini_set

(PHP 4 )

ini_set -- 設定オプションの値を設定する

説明

string ini_set ( string varname, string newvalue)

指定した設定オプションの値を設定します。成功時に元の値を、失敗し た際にFALSEを返します。設定オプションは、スクリプトの実行中新し い値を保持し、スクリプト終了時に元の値へ戻されます。

全てのオプションが ini_set() を使用して変更す ることが可能なわけではありません。以下にユーザのレベル毎に変更/設 定可能な(PHP 4.0.5-devにおける)全てのオプションのリストを示します。

表 1設定オプション

名前デフォルト変更の可否
define_syslog_variables"0"PHP_INI_ALL
highlight.bgHL_BG_COLORPHP_INI_ALL
highlight.commentHL_COMMENT_COLORPHP_INI_ALL
highlight.defaultHL_DEFAULT_COLORPHP_INI_ALL
highlight.htmlHL_HTML_COLORPHP_INI_ALL
highlight.keywordHL_KEYWORD_COLORPHP_INI_ALL
highlight.stringHL_STRING_COLORPHP_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_stringNULLPHP_INI_ALL
error_prepend_stringNULLPHP_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_ALL
magic_quotes_runtime"0"PHP_INI_ALL
magic_quotes_sybase"0"PHP_INI_ALL
output_buffering"0"PHP_INI_PERDIR|PHP_INI_SYSTEM
output_handlerNULLPHP_INI_PERDIR|PHP_INI_SYSTEM
register_argc_argv"1"PHP_INI_ALL
register_globals"1"PHP_INI_PERDIR|PHP_INI_SYSTEM
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_fileNULLPHP_INI_ALL
auto_prepend_fileNULLPHP_INI_ALL
doc_rootNULLPHP_INI_SYSTEM
default_charsetSAPI_DEFAULT_CHARSETPHP_INI_ALL
default_mimetypeSAPI_DEFAULT_MIMETYPEPHP_INI_ALL
error_logNULLPHP_INI_ALL
extension_dirPHP_EXTENSION_DIRPHP_INI_SYSTEM
gpc_order"GPC"PHP_INI_ALL
include_pathPHP_INCLUDE_PATHPHP_INI_ALL
max_execution_time"30"PHP_INI_ALL
open_basedirNULLPHP_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_dirNULLPHP_INI_SYSTEM
user_dirNULLPHP_INI_SYSTEM
variables_orderNULLPHP_INI_ALL
SMTP"localhost"PHP_INI_ALL
browscapNULLPHP_INI_SYSTEM
error_reportingNULLPHP_INI_ALL
memory_limit"8M"PHP_INI_ALL
precision"14"PHP_INI_ALL
sendmail_fromNULLPHP_INI_ALL
sendmail_pathDEFAULT_SENDMAIL_PATHPHP_INI_SYSTEM
disable_functions""PHP_INI_SYSTEM
allow_url_fopen"1"PHP_INI_ALL

表 2PHP_INI_* 定数の説明

定数意味
PHP_INI_USER1 このエントリは、ユーザスクリプトから設定可能
PHP_INI_PERDIR2 このエントリは、.htaccessから設定可能
PHP_INI_SYSTEM4 このエントリは、php.ini または httpd.conf で設定可能
PHP_INI_ALL7 このエントリはどこでも設定可能

ini_alter(), ini_get(), ini_restore()も参照下さい。