
漫画村を作ろうで教材として使われるPHPの「全て」を堪能します!!
上のリンク先の続きをこちらであげていきます。
質問
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On
[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
;date.timezone =
; https://php.net/date.default-latitude
;date.default_latitude = 31.7667
; https://php.net/date.default-longitude
;date.default_longitude = 35.2333
; https://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.833333
; https://php.net/date.sunset-zenith
;date.sunset_zenith = 90.833333
[filter]
; https://php.net/filter.default
;filter.default = unsafe_raw
; https://php.net/filter.default-flags
;filter.default_flags =
[iconv]
; Use of this INI entry is deprecated, use global input_encoding instead.
; If empty, default_charset or input_encoding or iconv.input_encoding is used.
; The precedence is: default_charset < input_encoding < iconv.input_encoding
;iconv.input_encoding =
; Use of this INI entry is deprecated, use global internal_encoding instead.
; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
;iconv.internal_encoding =
; Use of this INI entry is deprecated, use global output_encoding instead.
; If empty, default_charset or output_encoding or iconv.output_encoding is used.
; The precedence is: default_charset < output_encoding < iconv.output_encoding
; To use an output encoding conversion, iconv's output handler must be set
; otherwise output encoding conversion cannot be performed.
;iconv.output_encoding =
[imap]
; rsh/ssh logins are disabled by default. Use this INI entry if you want to
; enable them. Note that the IMAP library does not filter mailbox names before
; passing them to rsh/ssh command, thus passing untrusted data to this function
; with rsh/ssh enabled is insecure.
;imap.enable_insecure_rsh=0
[intl]
;intl.default_locale =
; This directive allows you to produce PHP errors when some error
; happens within intl functions. The value is the level of the error produced.
; Default is 0, which does not produce any errors.
;intl.error_level = E_WARNING
;intl.use_exceptions = 0
[sqlite3]
; Directory pointing to SQLite3 extensions
; https://php.net/sqlite3.extension-dir
;sqlite3.extension_dir =
; SQLite defensive mode flag (only available from SQLite 3.26+)
; When the defensive flag is enabled, language features that allow ordinary
; SQL to deliberately corrupt the database file are disabled. This forbids
; writing directly to the schema, shadow tables (eg. FTS data tables), or
; the sqlite_dbpage virtual table.
; https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
; (for older SQLite versions, this flag has no use)
;sqlite3.defensive = 1
[Pcre]
; PCRE library backtracking limit.
; https://php.net/pcre.backtrack-limit
;pcre.backtrack_limit=100000
; PCRE library recursion limit.
; Please note that if you set this value to a high number you may consume all
; the available process stack and eventually crash PHP (due to reaching the
; stack size limit imposed by the Operating System).
; https://php.net/pcre.recursion-limit
;pcre.recursion_limit=100000
; Enables or disables JIT compilation of patterns. This requires the PCRE
; library to be compiled with JIT support.
;pcre.jit=1
[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; https://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict
[Pdo_mysql]
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
pdo_mysql.default_socket=
[Phar]
; https://php.net/phar.readonly
;phar.readonly = On
; https://php.net/phar.require-hash
;phar.require_hash = On
;phar.cache_list =
[mail function]
; For Win32 only.
; https://php.net/smtp
SMTP = localhost
; https://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; https://php.net/sendmail-from
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; https://php.net/sendmail-path
;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off
; Use mixed LF and CRLF line separators to keep compatibility with some
; RFC 2822 non conformant MTA.
mail.mixed_lf_and_crlf = Off
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
[ODBC]
; https://php.net/odbc.default-db
;odbc.default_db = Not yet implemented
; https://php.net/odbc.default-user
;odbc.default_user = Not yet implemented
; https://php.net/odbc.default-pw
;odbc.default_pw = Not yet implemented
; Controls the ODBC cursor model.
; Default: SQL_CURSOR_STATIC (default).
;odbc.default_cursortype
; Allow or prevent persistent links.
; https://php.net/odbc.allow-persistent
odbc.allow_persistent = On
; Check that a connection is still valid before reuse.
; https://php.net/odbc.check-persistent
odbc.check_persistent = On
; Maximum number of persistent links. -1 means no limit.
; https://php.net/odbc.max-persistent
odbc.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
; https://php.net/odbc.max-links
odbc.max_links = -1
; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
; https://php.net/odbc.defaultlrl
odbc.defaultlrl = 4096
; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of odbc.defaultlrl and odbc.defaultbinmode
; https://php.net/odbc.defaultbinmode
odbc.defaultbinmode = 1
[MySQLi]
; Maximum number of persistent links. -1 means no limit.
; https://php.net/mysqli.max-persistent
mysqli.max_persistent = -1
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; https://php.net/mysqli.allow_local_infile
;mysqli.allow_local_infile = On
; It allows the user to specify a folder where files that can be sent via LOAD DATA
; LOCAL can exist. It is ignored if mysqli.allow_local_infile is enabled.
;mysqli.local_infile_directory =
; Allow or prevent persistent links.
; https://php.net/mysqli.allow-persistent
mysqli.allow_persistent = On
; Maximum number of links. -1 means no limit.
; https://php.net/mysqli.max-links
mysqli.max_links = -1
; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
; https://php.net/mysqli.default-port
mysqli.default_port = 3306
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; https://php.net/mysqli.default-socket
mysqli.default_socket =
; Default host for mysqli_connect() (doesn't apply in safe mode).
; https://php.net/mysqli.default-host
mysqli.default_host =
; Default user for mysqli_connect() (doesn't apply in safe mode).
; https://php.net/mysqli.default-user
mysqli.default_user =
; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
; https://php.net/mysqli.default-pw
mysqli.default_pw =
; If this option is enabled, closing a persistent connection will rollback
; any pending transactions of this connection, before it is put back
; into the persistent connection pool.
;mysqli.rollback_on_cached_plink = Off
978~1219行目の解説をお願いします。
回答
以下は、`php.ini` ファイルの行 978~1219 の解説です。この部分は、モジュール設定、日時設定、フィルタ設定、文字エンコード設定、IMAP、国際化(intl)、SQLite3、PCRE、PDO、メール機能、ODBC、MySQLi の設定に関するオプションを含んでいます。
### Module Settings セクション
#### [CLI Server]
- **cli_server.color**
- **説明:** CLI Webサーバが端末出力でANSIカラコーディングを使用するかどうかを決定します。
- **設定例:** `cli_server.color = On`
### Date セクション
- **date.timezone**
- **説明:** 日付関数で使用するデフォルトのタイムゾーンを定義します。
- **設定例:** コメントアウトされていますが、使用する場合は `date.timezone = "Europe/Berlin"`
- **date.default_latitude**
- **説明:** デフォルトの緯度を定義します。
- **設定例:** 例では `31.7667`
- **date.default_longitude**
- **説明:** デフォルトの経度を定義します。
- **設定例:** 例では `35.2333`
- **date.sunrise_zenith**
- **説明:** 日の出のゼニス角を設定します。
- **設定例:** 例では `90.833333`
- **date.sunset_zenith**
- **説明:** 日の入りのゼニス角を設定します。
- **設定例:** 例では `90.833333`
### Filter セクション
- **filter.default**
- **説明:** デフォルトのフィルタを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `filter.default = unsafe_raw`
- **filter.default_flags**
- **説明:** デフォルトのフィルタフラグを設定します。
- **設定例:** コメントアウトされています。
### Iconv セクション
- **iconv.input_encoding**
- **説明:** デフォルトの入力エンコーディングを設定します。非推奨であるため、代わりに `input_encoding` を使用します。
- **設定例:** コメントアウトされています。
- **iconv.internal_encoding**
- **説明:** デフォルトの内部エンコーディングを設定します。非推奨であるため、代わりに `internal_encoding` を使用します。
- **設定例:** コメントアウトされています。
- **iconv.output_encoding**
- **説明:** デフォルトの出力エンコーディングを設定します。非推奨であるため、代わりに `output_encoding` を使用します。
- **設定例:** コメントアウトされています。
### IMAP セクション
- **imap.enable_insecure_rsh**
- **説明:** rsh/ssh ログインを有効にするかどうかを決定します。セキュリティ上のリスクがあるため、慎重に使用する必要があります。
- **設定例:** `imap.enable_insecure_rsh = 0`
### Internationalization (Intl) セクション
- **intl.default_locale**
- **説明:** デフォルトのロケールを設定します。
- **設定例:** コメントアウトされています。
- **intl.error_level**
- **説明:** Intl関数内でエラーが発生した場合にPHPエラーを生成するかどうかを決定します。
- **設定例:** `intl.error_level = E_WARNING`
- **intl.use_exceptions**
- **説明:** Intl関数で例外を使用するかどうかを決定します。
- **設定例:** `intl.use_exceptions = 0`
### SQLite3 セクション
- **sqlite3.extension_dir**
- **説明:** SQLite3拡張機能が存在するディレクトリを設定します。
- **設定例:** コメントアウトされています。
- **sqlite3.defensive**
- **説明:** SQLite 3.26+の「防御モード」フラグを設定します。通常のSQL文がデータベースファイルを破損することを防ぐためのものです。
- **設定例:** `sqlite3.defensive = 1`
### PCRE セクション
- **pcre.backtrack_limit**
- **説明:** PCREライブラリのバックトラッキングリミットを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `pcre.backtrack_limit = 100000`
- **pcre.recursion_limit**
- **説明:** PCREライブラリの再帰リミットを設定します。高すぎる値を設定すると、スタックオーバーフローが発生する可能性があります。
- **設定例:** コメントアウトされていますが、使用する場合は `pcre.recursion_limit = 100000`
- **pcre.jit**
- **説明:** パターンのJITコンパイルを有効または無効にします。PCREライブラリがJITサポートでコンパイルされている必要があります。
- **設定例:** コメントアウトされていますが、使用する場合は `pcre.jit = 1`
### PDO セクション
- **pdo_odbc.connection_pooling**
- **説明:** ODBC接続のプールを設定します。値は "strict", "relaxed", "off" のいずれかです。
- **設定例:** コメントアウトされていますが、使用する場合は `pdo_odbc.connection_pooling = strict`
- **pdo_mysql.default_socket**
- **説明:** ローカルMySQL接続のデフォルトソケット名を設定します。空の場合、ビルトインのMySQLデフォルトが使用されます。
- **設定例:** `pdo_mysql.default_socket =`
### Phar セクション
- **phar.readonly**
- **説明:** `phar` 拡張を読み取り専用にするかどうかを決定します。
- **設定例:** コメントアウトされていますが、使用する場合は `phar.readonly = On`
- **phar.require_hash**
- **説明:** Pharアーカイブにハッシュを必須とするかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `phar.require_hash = On`
- **phar.cache_list**
- **説明:** 缶載Parファイルをキャッシュするためのリストを設定します。
- **設定例:** コメントアウトされています。
### Mail Function セクション
- **SMTP**
- **説明:** SMTPサーバーのアドレス。Win32環境専用です。
- **設定例:** `SMTP = localhost`
- **smtp_port**
- **説明:** SMTPサーバーのポート番号。Win32環境専用です。
- **設定例:** `smtp_port = 25`
- **sendmail_from**
- **説明:** 送信元メールアドレス。Win32環境専用です。
- **設定例:** コメントアウトされています。
- **sendmail_path**
- **説明:** sendmailのパス。Unix環境専用です。
- **設定例:** コメントアウトされています。
- **mail.force_extra_parameters**
- **説明:** sendmailバイナリに渡される追加パラメータを設定します。
- **設定例:** コメントアウトされています。
- **mail.add_x_header**
- **説明:** 送信メールにスクリプトのUIDとファイル名を含む `X-PHP-Originating-Script` ヘッダーを追加するかどうかを決定します。
- **設定例:** `mail.add_x_header = Off`
- **mail.mixed_lf_and_crlf**
- **説明:** LFとCRLFの行区切りを混在させるかどうかを決定します。
- **設定例:** `mail.mixed_lf_and_crlf = Off`
- **mail.log**
- **説明:** すべての `mail()` 呼び出しを記録するログファイルのパスを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mail.log = /path/to/log`
### ODBC セクション
- **odbc.default_db**
- **説明:** デフォルトのデータベースを設定します。未実装です。
- **設定例:** コメントアウトされています。
- **odbc.default_user**
- **説明:** デフォルトのユーザーを設定します。未実装です。
- **設定例:** コメントアウトされています。
- **odbc.default_pw**
- **説明:** デフォルトのパスワードを設定します。未実装です。
- **設定例:** コメントアウトされています。
- **odbc.default_cursortype**
- **説明:** ODBCカーソルモデルを制御します。デフォルトは `SQL_CURSOR_STATIC` です。
- **設定例:** コメントアウトされています。
- **odbc.allow_persistent**
- **説明:** 永続的リンクを許可するかどうかを決定します。
- **設定例:** `odbc.allow_persistent = On`
- **odbc.check_persistent**
- **説明:** 再利用する前に接続が有効かどうかをチェックするかどうかを決定します。
- **設定例:** `odbc.check_persistent = On`
- **odbc.max_persistent**
- **説明:** 永続的リンクの最大数を設定します。 `-1` は無制限を意味します。
- **設定例:** `odbc.max_persistent = -1`
- **odbc.max_links**
- **説明:** リンクの最大数を設定します(永続的リンク+非永続的リンクの合計)。`-1` は無制限を意味します。
- **設定例:** `odbc.max_links = -1`
- **odbc.defaultlrl**
- **説明:** LONGフィールドの処理方法を設定します。 `0` はパススルーを意味します。
- **設定例:** `odbc.defaultlrl = 4096`
- **odbc.defaultbinmode**
- **説明:** バイナリデータの処理方法を設定します。`0` はパススルー、`1` はそのまま返す、`2` は文字列に変換することを意味します。
- **設定例:** `odbc.defaultbinmode = 1`
### MySQLi セクション
- **mysqli.max_persistent**
- **説明:** 永続的リンクの最大数を設定します。 `-1` は無制限を意味します。
- **設定例:** `mysqli.max_persistent = -1`
- **mysqli.allow_local_infile**
- **説明:** PHPの観点から見てローカルファイルを `LOAD DATA` で使用することを許可するかどうかを決定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqli.allow_local_infile = On`
- **mysqli.local_infile_directory**
- **説明:** ファイルを保持するフォルダを指定します。 `mysqli.allow_local_infile` が有効な場合のみ有効です。
- **設定例:** コメントアウトされています。
- **mysqli.allow_persistent**
- **説明:** 永続的リンクを許可するかどうかを決定します。
- **設定例:** `mysqli.allow_persistent = On`
- **mysqli.max_links**
- **説明:** リンクの最大数を設定します。 `-1` は無制限を意味します。
- **設定例:** `mysqli.max_links = -1`
- **mysqli.default_port**
- **説明:** `mysqli_connect()` のデフォルトポート番号を設定します。未設定の場合、 `MYSQL_TCP_PORT` や `/etc/services` の `mysql-tcp` エントリ、コンパイル時に定義された `MYSQL_PORT` が使用されます。
- **設定例:** `mysqli.default_port = 3306`
- **mysqli.default_socket**
- **説明:** ローカルMySQL接続のデフォルトソケット名を設定します。空の場合、ビルトインのMySQLデフォルトが使用されます。
- **設定例:** `mysqli.default_socket =`
- **mysqli.default_host**
- **説明:** `mysqli_connect()` のデフォルトホストを設定します。
- **設定例:** `mysqli.default_host =`
- **mysqli.default_user**
- **説明:** `mysqli_connect()` のデフォルトユーザーを設定します。
- **設定例:** `mysqli.default_user =`
- **mysqli.default_pw**
- **説明:** `mysqli_connect()` のデフォルトパスワードを設定します。このファイルにパスワードを保存することは一般的に良くないです。
- **設定例:** `mysqli.default_pw =`
- **mysqli.rollback_on_cached_plink**
- **説明:** 永続的接続を閉じる際に、保留中のトランザクションをロールバックするかどうかを決定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqli.rollback_on_cached_plink = Off`
これらの設定は、PHPが提供するさまざまな機能とモジュールの動作に関するものです。適切に設定することで、アプリケーションのパフォーマンスとセキュリティを維持しつつ、必要な機能を有効にすることができます。
質問
[mysqlnd]
; Enable / Disable collection of general statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
mysqlnd.collect_statistics = On
; Enable / Disable collection of memory usage statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
mysqlnd.collect_memory_statistics = Off
; Records communication from all extensions using mysqlnd to the specified log
; file.
; https://php.net/mysqlnd.debug
;mysqlnd.debug =
; Defines which queries will be logged.
;mysqlnd.log_mask = 0
; Default size of the mysqlnd memory pool, which is used by result sets.
;mysqlnd.mempool_default_size = 16000
; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
;mysqlnd.net_cmd_buffer_size = 2048
; Size of a pre-allocated buffer used for reading data sent by the server in
; bytes.
;mysqlnd.net_read_buffer_size = 32768
; Timeout for network requests in seconds.
;mysqlnd.net_read_timeout = 31536000
; SHA-256 Authentication Plugin related. File with the MySQL server public RSA
; key.
;mysqlnd.sha256_server_public_key =
[OCI8]
; Connection: Enables privileged connections using external
; credentials (OCI_SYSOPER, OCI_SYSDBA)
; https://php.net/oci8.privileged-connect
;oci8.privileged_connect = Off
; Connection: The maximum number of persistent OCI8 connections per
; process. Using -1 means no limit.
; https://php.net/oci8.max-persistent
;oci8.max_persistent = -1
; Connection: The maximum number of seconds a process is allowed to
; maintain an idle persistent connection. Using -1 means idle
; persistent connections will be maintained forever.
; https://php.net/oci8.persistent-timeout
;oci8.persistent_timeout = -1
; Connection: The number of seconds that must pass before issuing a
; ping during oci_pconnect() to check the connection validity. When
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
; pings completely.
; https://php.net/oci8.ping-interval
;oci8.ping_interval = 60
; Connection: Set this to a user chosen connection class to be used
; for all pooled server requests with Oracle Database Resident
; Connection Pooling (DRCP). To use DRCP, this value should be set to
; the same string for all web servers running the same application,
; the database pool must be configured, and the connection string must
; specify to use a pooled server.
;oci8.connection_class =
; High Availability: Using On lets PHP receive Fast Application
; Notification (FAN) events generated when a database node fails. The
; database must also be configured to post FAN events.
;oci8.events = Off
; Tuning: This option enables statement caching, and specifies how
; many statements to cache. Using 0 disables statement caching.
; https://php.net/oci8.statement-cache-size
;oci8.statement_cache_size = 20
; Tuning: Enables row prefetching and sets the default number of
; rows that will be fetched automatically after statement execution.
; https://php.net/oci8.default-prefetch
;oci8.default_prefetch = 100
; Tuning: Sets the amount of LOB data that is internally returned from
; Oracle Database when an Oracle LOB locator is initially retrieved as
; part of a query. Setting this can improve performance by reducing
; round-trips.
; https://php.net/oci8.prefetch-lob-size
; oci8.prefetch_lob_size = 0
; Compatibility. Using On means oci_close() will not close
; oci_connect() and oci_new_connect() connections.
; https://php.net/oci8.old-oci-close-semantics
;oci8.old_oci_close_semantics = Off
[PostgreSQL]
; Allow or prevent persistent links.
; https://php.net/pgsql.allow-persistent
pgsql.allow_persistent = On
; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
; https://php.net/pgsql.auto-reset-persistent
pgsql.auto_reset_persistent = Off
; Maximum number of persistent links. -1 means no limit.
; https://php.net/pgsql.max-persistent
pgsql.max_persistent = -1
; Maximum number of links (persistent+non persistent). -1 means no limit.
; https://php.net/pgsql.max-links
pgsql.max_links = -1
; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
; https://php.net/pgsql.ignore-notice
pgsql.ignore_notice = 0
; Log PostgreSQL backends Notice message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
; https://php.net/pgsql.log-notice
pgsql.log_notice = 0
[bcmath]
; Number of decimal digits for all bcmath functions.
; https://php.net/bcmath.scale
bcmath.scale = 0
[browscap]
; https://php.net/browscap
;browscap = extra/browscap.ini
1221~1350行目の解説をお願いします
回答
以下は、`php.ini` ファイルの行 1221~1350 の解説です。この部分は、MySQL Native Driver (mysqlnd)、OCI8、PostgreSQL、BCMath、browscap の設定に関するオプションを含んでいます。
### mysqlnd セクション
#### mysqlnd.collect_statistics
- **説明:** mysqlnd が一般的な統計情報を収集するかどうかを設定します。この情報は MySQL 操作のチューニングと監視に使用できます。
- **設定例:** `mysqlnd.collect_statistics = On`
#### mysqlnd.collect_memory_statistics
- **説明:** mysqlnd がメモリ使用量統計を収集するかどうかを設定します。この情報は MySQL 操作のチューニングと監視に使用できます。
- **設定例:** `mysqlnd.collect_memory_statistics = Off`
#### mysqlnd.debug
- **説明:** mysqlnd を使用するすべての拡張機能からの通信を指定したログファイルに記録します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqlnd.debug = /path/to/logfile`
#### mysqlnd.log_mask
- **説明:** ログ記録されるクエリを定義します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqlnd.log_mask = 0`
#### mysqlnd.mempool_default_size
- **説明:** 結果セットに使用される mysqlnd メモリプールのデフォルトサイズを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqlnd.mempool_default_size = 16000`
#### mysqlnd.net_cmd_buffer_size
- **説明:** MySQL にコマンドを送信する際に使用される事前割り当てバッファのサイズをバイト単位で設定します。
- **設定例:** `mysqlnd.net_cmd_buffer_size = 2048`
#### mysqlnd.net_read_buffer_size
- **説明:** サーバーから送信されたデータを読み取る際の事前割り当てバッファのサイズをバイト単位で設定します。
- **設定例:** `mysqlnd.net_read_buffer_size = 32768`
#### mysqlnd.net_read_timeout
- **説明:** ネットワーク要求のタイムアウトを秒単位で設定します。
- **設定例:** `mysqlnd.net_read_timeout = 31536000`
#### mysqlnd.sha256_server_public_key
- **説明:** SHA-256 認証プラグイン関連。MySQL サーバーの公開RSAキーが格納されるファイルを指定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mysqlnd.sha256_server_public_key = /path/to/public_key.pem`
### OCI8 セクション
#### oci8.privileged_connect
- **説明:** 外部認証情報(OCI_SYSOPER、OCI_SYSDBA)を使用して特権接続を有効にするかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.privileged_connect = Off`
#### oci8.max_persistent
- **説明:** プロセスごとの永続的 OCI8 接続の最大数を設定します。`-1` は無制限を意味します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.max_persistent = -1`
#### oci8.persistent_timeout
- **説明:** 永続的接続がアイドル状態のまま維持される最大秒数を設定します。`-1` は無制限を意味します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.persistent_timeout = -1`
#### oci8.ping_interval
- **説明:** 接続の有効性をチェックするために `oci_pconnect()` の間で ping を発行するまでの秒数を設定します。`0` に設定すると、各 `oci_pconnect()` 呼び出しにより ping が発行されます。`-1` に設定すると ping は完全に無効になります。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.ping_interval = 60`
#### oci8.connection_class
- **説明:** Oracle データベースの DRCP を使用するすべてのプールされたサーバー要求に使用される接続クラスを設定します。
- **設定例:** コメントアウトされています。
#### oci8.events
- **説明:** プロセスがデータベースノードの障害時に発生するファストアプリケーション通知(FAN)イベントを受信できるように設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.events = Off`
#### oci8.statement_cache_size
- **説明:** ステートメントキャッシュを有効にし、キャッシュするステートメントの数を設定します。`0` に設定するとステートメントキャッシュは無効になります。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.statement_cache_size = 20`
#### oci8.default_prefetch
- **説明:** ステートメント実行後に自動的にフェッチされる行数のデフォルト値を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.default_prefetch = 100`
#### oci8.prefetch_lob_size
- **説明:** Oracle データベースから内部的に取得される LOB データの量を設定します。これによりパフォーマンスが向上します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.prefetch_lob_size = 0`
#### oci8.old_oci_close_semantics
- **説明:** `oci_close()` が `oci_connect()` や `oci_new_connect()` 接続を閉じない場合は On に設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `oci8.old_oci_close_semantics = Off`
### PostgreSQL セクション
#### pgsql.allow_persistent
- **説明:** 永続的リンクを許可するかどうかを決定します。
- **設定例:** `pgsql.allow_persistent = On`
#### pgsql.auto_reset_persistent
- **説明:** `pg_pconnect()` を使用して永続的リンクの有効性を常に検出するかどうかを決定します。自動リセット機能には少しオーバーヘッドがかかります。
- **設定例:** コメントアウトされていますが、使用する場合は `pgsql.auto_reset_persistent = Off`
#### pgsql.max_persistent
- **説明:** 永続的リンクの最大数を設定します。`-1` は無制限を意味します。
- **設定例:** `pgsql.max_persistent = -1`
#### pgsql.max_links
- **説明:** リンクの最大数(永続的リンク+非永続的リンク)を設定します。`-1` は無制限を意味します。
- **設定例:** `pgsql.max_links = -1`
#### pgsql.ignore_notice
- **説明:** PostgreSQLバックエンドの通知メッセージを無視するかどうかを決定します。通知メッセージのロギングには少しオーバーヘッドがかかります。
- **設定例:** `pgsql.ignore_notice = 0`
#### pgsql.log_notice
- **説明:** PostgreSQLバックエンドの通知メッセージをログに記録するかどうかを決定します。`pgsql.ignore_notice = 0` でなければ、このモジュールは通知メッセージをログに記録できません。
- **設定例:** `pgsql.log_notice = 0`
### BCMath セクション
#### bcmath.scale
- **説明:** すべてのBCMath関数に対して小数点以下の桁数を設定します。
- **設定例:** `bcmath.scale = 0`
### Browscap セクション
#### browscap
- **説明:** ブラウザの機能を記述したデータファイルのパスを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `browscap = /path/to/browscap.ini`
これらの設定は、PHPがさまざまなデータベースや数学ライブラリを操作する方法を細かく制御するためのものです。適切な設定を行うことで、PHPアプリケーションのパフォーマンスやセキュリティを最適化できます。
質問
[Session]
; Handler used to store/retrieve data.
; https://php.net/session.save-handler
session.save_handler = files
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; The path can be defined as:
;
; session.save_path = "N;/path"
;
; where N is an integer. Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories. This is useful if
; your OS has problems with many files in one directory, and is
; a more efficient layout for servers that handle many sessions.
;
; NOTE 1: PHP will not create this directory structure automatically.
; You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
; use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
; session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
; https://php.net/session.save-path
;session.save_path = "/var/lib/php/sessions"
; Whether to use strict session mode.
; Strict session mode does not accept an uninitialized session ID, and
; regenerates the session ID if the browser sends an uninitialized session ID.
; Strict mode protects applications from session fixation via a session adoption
; vulnerability. It is disabled by default for maximum compatibility, but
; enabling it is encouraged.
; https://wiki.php.net/rfc/strict_sessions
session.use_strict_mode = 0
; Whether to use cookies.
; https://php.net/session.use-cookies
session.use_cookies = 1
; https://php.net/session.cookie-secure
;session.cookie_secure =
; This option forces PHP to fetch and use a cookie for storing and maintaining
; the session id. We encourage this operation as it's very helpful in combating
; session hijacking when not specifying and managing your own session id. It is
; not the be-all and end-all of session hijacking defense, but it's a good start.
; https://php.net/session.use-only-cookies
session.use_only_cookies = 1
; Name of the session (used as cookie name).
; https://php.net/session.name
session.name = PHPSESSID
; Initialize session on request startup.
; https://php.net/session.auto-start
session.auto_start = 0
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
; https://php.net/session.cookie-lifetime
session.cookie_lifetime = 0
; The path for which the cookie is valid.
; https://php.net/session.cookie-path
session.cookie_path = /
; The domain for which the cookie is valid.
; https://php.net/session.cookie-domain
session.cookie_domain =
; Whether or not to add the httpOnly flag to the cookie, which makes it
; inaccessible to browser scripting languages such as JavaScript.
; https://php.net/session.cookie-httponly
session.cookie_httponly =
; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF)
; Current valid values are "Strict", "Lax" or "None". When using "None",
; make sure to include the quotes, as `none` is interpreted like `false` in ini files.
; https://tools.ietf.org/html/draft-west-first-party-cookies-07
session.cookie_samesite =
; Handler used to serialize data. php is the standard serializer of PHP.
; https://php.net/session.serialize-handler
session.serialize_handler = php
; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
; https://php.net/session.gc-probability
; Debian Default Value: 0
; This is disabled in the Debian packages due to the strict permissions
; on /var/lib/php. Instead, GC is performed through /etc/cron.d/php,
; which uses the session.gc_maxlifetime setting. Please, check
; /usr/share/doc/php8.2-common/README.Debian.gz for further reference.
session.gc_probability = 0
; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.
; For high volume production servers, using a value of 1000 is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; https://php.net/session.gc-divisor
session.gc_divisor = 1000
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; https://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 1440
; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script is the equivalent of setting
; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; find /path/to/sessions -cmin +24 -type f | xargs rm
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
; https://php.net/session.referer-check
session.referer_check =
; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
; https://php.net/session.cache-limiter
session.cache_limiter = nocache
; Document expires after n minutes.
; https://php.net/session.cache-expire
session.cache_expire = 180
; trans sid support is disabled by default.
; Use of trans sid may risk your users' security.
; Use this option with caution.
; - User may send URL contains active session ID
; to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
; in publicly accessible computer.
; - User may access your site with the same session ID
; always using URL stored in browser's history or bookmarks.
; https://php.net/session.use-trans-sid
session.use_trans_sid = 0
; Set session ID character length. This value could be between 22 to 256.
; Shorter length than default is supported only for compatibility reason.
; Users should use 32 or more chars.
; https://php.net/session.sid-length
; Default Value: 32
; Development Value: 26
; Production Value: 26
session.sid_length = 26
; The URL rewriter will look for URLs in a defined set of HTML tags.
; <form> is special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs. <form> tag's action attribute URL will not be modified
; unless it is specified.
; Note that all valid entries require a "=", even if no value follows.
; Default Value: "a=href,area=href,frame=src,form="
; Development Value: "a=href,area=href,frame=src,form="
; Production Value: "a=href,area=href,frame=src,form="
; https://php.net/url-rewriter.tags
session.trans_sid_tags = "a=href,area=href,frame=src,form="
; URL rewriter does not rewrite absolute URLs by default.
; To enable rewrites for absolute paths, target hosts must be specified
; at RUNTIME. i.e. use ini_set()
; <form> tags is special. PHP will check action attribute's URL regardless
; of session.trans_sid_tags setting.
; If no host is defined, HTTP_HOST will be used for allowed host.
; Example value: php.net,www.php.net,wiki.php.net
; Use "," for multiple hosts. No spaces are allowed.
; Default Value: ""
; Development Value: ""
; Production Value: ""
;session.trans_sid_hosts=""
; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
; Possible values:
; 4 (4 bits: 0-9, a-f)
; 5 (5 bits: 0-9, a-v)
; 6 (6 bits: 0-9, a-z, A-Z, "-", ",")
; Default Value: 4
; Development Value: 5
; Production Value: 5
; https://php.net/session.hash-bits-per-character
session.sid_bits_per_character = 5
; Enable upload progress tracking in $_SESSION
; Default Value: On
; Development Value: On
; Production Value: On
; https://php.net/session.upload-progress.enabled
;session.upload_progress.enabled = On
; Cleanup the progress information as soon as all POST data has been read
; (i.e. upload completed).
; Default Value: On
; Development Value: On
; Production Value: On
; https://php.net/session.upload-progress.cleanup
;session.upload_progress.cleanup = On
; A prefix used for the upload progress key in $_SESSION
; Default Value: "upload_progress_"
; Development Value: "upload_progress_"
; Production Value: "upload_progress_"
; https://php.net/session.upload-progress.prefix
;session.upload_progress.prefix = "upload_progress_"
; The index name (concatenated with the prefix) in $_SESSION
; containing the upload progress information
; Default Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Development Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Production Value: "PHP_SESSION_UPLOAD_PROGRESS"
; https://php.net/session.upload-progress.name
;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"
; How frequently the upload progress should be updated.
; Given either in percentages (per-file), or in bytes
; Default Value: "1%"
; Development Value: "1%"
; Production Value: "1%"
; https://php.net/session.upload-progress.freq
;session.upload_progress.freq = "1%"
; The minimum delay between updates, in seconds
; Default Value: 1
; Development Value: 1
; Production Value: 1
; https://php.net/session.upload-progress.min-freq
;session.upload_progress.min_freq = "1"
; Only write session data when session data is changed. Enabled by default.
; https://php.net/session.lazy-write
;session.lazy_write = On
1352~1601行目の解説をお願いします
回答
以下は、`php.ini` ファイルの行 1352~1601 の解説です。この部分は、PHPのセッション管理に関する設定オプションが含まれており、セッションデータの保存、セッションIDの管理、クッキーの使用、ガベージコレクション、セッションハイジャック防止などに関する設定が定義されています。
### Session セクション
#### session.save_handler
- **説明:** セッションデータを保存/取得するためのハンドラを設定します。デフォルトはファイル保存です。
- **設定例:** `session.save_handler = files`
#### session.save_path
- **説明:** セッションデータファイルが保存されるパスを設定します。Windowsユーザーは変える必要があります。
- **設定例:** コメントアウトされていますが、使用する場合は例: `session.save_path = "/var/lib/php/sessions"`
#### session.use_strict_mode
- **説明:** 厳密セッションモードを使用するかどうかを設定します。未初期化のセッションIDを受け付けず、セッション固定攻撃を防止します。
- **設定例:** `session.use_strict_mode = 0`
#### session.use_cookies
- **説明:** セッションIDをクッキーで管理するかどうかを設定します。
- **設定例:** `session.use_cookies = 1`
#### session.cookie_secure
- **説明:** セキュアなクッキー(HTTPSのみで送信)を使用するかどうかを設定します。
- **設定例:** コメントアウトされています。
#### session.use_only_cookies
- **説明:** セッションIDをクッキーのみで管理するかどうかを設定します。この設定を推奨します。
- **設定例:** `session.use_only_cookies = 1`
#### session.name
- **説明:** セッションの名前(クッキー名として使用)を設定します。
- **設定例:** `session.name = PHPSESSID`
#### session.auto_start
- **説明:** リクエストの開始時にセッションを自動的に開始するかどうかを決定します。
- **設定例:** `session.auto_start = 0`
#### session.cookie_lifetime
- **説明:** クッキーの有効期間を秒単位で設定します。0はブラウザのセッション終了時まで有効です。
- **設定例:** `session.cookie_lifetime = 0`
#### session.cookie_path
- **説明:** クッキーが有効なパスを設定します。
- **設定例:** `session.cookie_path = /`
#### session.cookie_domain
- **説明:** クッキーが有効なドメインを設定します。
- **設定例:** コメントアウトされています。
#### session.cookie_httponly
- **説明:** クッキーにHttpOnlyフラグを追加して、JavaScriptによるアクセスを防ぐかどうかを設定します。
- **設定例:** コメントアウトされています。
#### session.cookie_samesite
- **説明:** CSRF/XSRF攻撃を軽減するためのクッキーのSameSite属性を設定します。
- **設定例:** コメントアウトされています。
#### session.serialize_handler
- **説明:** データのシリアル化に使用するハンドラを設定します。標準はphpです。
- **設定例:** `session.serialize_handler = php`
#### session.gc_probability
- **説明:** セッションの初期化ごとにガベージコレクションプロセスが開始される確率を定義します。Debianのデフォルトでは無効です。
- **設定例:** `session.gc_probability = 0`
#### session.gc_divisor
- **説明:** ガベージコレクションの確率を設定します。高トラフィックの本番サーバでは1000を使用することが推奨されます。
- **設定例:** `session.gc_divisor = 1000`
#### session.gc_maxlifetime
- **説明:** セッションデータが「ガベージ」と見なされるまでの最大時間を秒単位で設定します。
- **設定例:** `session.gc_maxlifetime = 1440`
#### session.referer_check
- **説明:** 外部に保存されたURLがIDを含む場合、セッションが無効と見なされるかどうかを設定します。
- **設定例:** コメントアウトされています。
#### session.cache_limiter
- **説明:** HTTPキャッシングのアスペクトを設定します。デフォルトはnocacheです。
- **設定例:** `session.cache_limiter = nocache`
#### session.cache_expire
- **説明:** ドキュメントの有効期限を分単位で設定します。
- **設定例:** `session.cache_expire = 180`
#### session.use_trans_sid
- **説明:** trans-sidサポートを有効にするかどうかを設定します。セキュリティリスクがあるため、デフォルトでは無効です。
- **設定例:** `session.use_trans_sid = 0`
#### session.sid_length
- **説明:** セッションIDの文字数を設定します(22〜256の間で指定可能)。
- **設定例:** `session.sid_length = 26`
#### session.trans_sid_tags
- **説明:** URLリライタがHTMLタグ内でURLを検索する際に見るタグのセットを設定します。
- **設定例:** `session.trans_sid_tags = "a=href,area=href,frame=src,form="`
#### session.trans_sid_hosts
- **説明:** 絶対URLの書き換えが許可されるホストを指定します。
- **設定例:** コメントアウトされています。
#### session.sid_bits_per_character
- **説明:** バイナリハッシュデータを読み取り可能な形式に変換する際に、各文字に格納されるビット数を定義します。
- **設定例:** `session.sid_bits_per_character = 5`
#### session.upload_progress.enabled
- **説明:** アップロード進捗のトラッキングを有効にするかどうかを決定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.enabled = On`
#### session.upload_progress.cleanup
- **説明:** POSTデータがすべて読み取られると(アップロード完了後)進捗情報をクリーンアップするかどうかを決定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.cleanup = On`
#### session.upload_progress.prefix
- **説明:** $_SESSION 内のアップロード進捗キーに使用されるプレフィックスを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.prefix = "upload_progress_"`
#### session.upload_progress.name
- **説明:** $_SESSION 内のアップロード進捗情報を格納するインデックス名(プレフィックスと連結される)を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"`
#### session.upload_progress.freq
- **説明:** アップロード進捗が更新される頻度を設定します。パーセンテージ(ファイルごと)またはバイト数で指定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.freq = "1%"`
#### session.upload_progress.min_freq
- **説明:** アップロード進捗更新の間の最小遅延を秒単位で設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `session.upload_progress.min_freq = "1"`
#### session.lazy_write
- **説明:** セッションデータが変更されたときのみ書き込むようにします。デフォルトで有効です。
- **設定例:** コメントアウトされていますが、使用する場合は `session.lazy_write = On`
これらの設定は、セッションの管理、セッションIDとクッキーの作成および管理、セッションハイジャック防止、ガベージコレクション、セッション保存場所など、PHPセッションの動作を詳細に制御するためのものです。セキュリティやパフォーマンスを確保するために、環境や要件に応じた適切な設定を行うことが重要です。