上のリンク先の続きです。
質問
回答
以下は、`php.ini` ファイルの行 1603~1778 の解説です。この部分には、アサーション、COM、mbstring、gd、exif、Tidy、SOAP、sysvshm、LDAP、およびDBA関連の設定オプションが含まれています。
### Assertion セクション
#### zend.assertions
- **説明:** アサーションをコンパイルするかどうかを設定します。ランタイムでのオーバーヘッドを避けるために使用します。
- **設定例:** `zend.assertions = -1`
- `-1`: アサーションを全くコンパイルしない
- `0`: ランタイムでアサーションをジャンプ
- `1`: アサーションを実行
### COM セクション
#### com.typelib_file
- **説明:** GUIDs、IIDsまたはファイル名を含むファイルのパスを設定します。
- **設定例:** コメントアウトされています。
#### com.allow_dcom
- **説明:** 分散COM呼び出しを許可するかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `com.allow_dcom = true`
#### com.autoregister_typelib
- **説明:** `com_load()` 時にコンポーネントのタイプライブラリの定数を自動登録するかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `com.autoregister_typelib = true`
#### com.autoregister_casesensitive
- **説明:** 登録された定数のケースセンシティビティを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `com.autoregister_casesensitive = false`
#### com.autoregister_verbose
- **説明:** 重複する定数の登録時に警告を表示するかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `com.autoregister_verbose = true`
#### com.code_page
- **説明:** COMオブジェクトとの文字列の入出力時に使用するデフォルトの文字セットコードページを設定します。
- **設定例:** コメントアウトされています。
#### com.dotnet_version
- **説明:** 使用する.NETフレームワークのバージョンを設定します。例:`"v4.0.30319"`
- **設定例:** コメントアウトされています。
### Mbstring セクション
#### mbstring.language
- **説明:** 内部文字表現に使用する言語を設定します。これは `mb_send_mail()` や `mbstring.detect_order` に影響します。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.language = Japanese`
#### mbstring.internal_encoding
- **説明:** 内部エンコーディングを設定します。非推奨であるため、代わりに `internal_encoding` を使用します。
- **設定例:** コメントアウトされています。
#### mbstring.http_input
- **説明:** HTTP入力エンコーディングを設定します。非推奨であるため、代わりに `input_encoding` を使用します。
- **設定例:** コメントアウトされています。
#### mbstring.http_output
- **説明:** HTTP出力エンコーディングを設定します。非推奨であるため、代わりに `output_encoding` を使用します。
- **設定例:** コメントアウトされています。
#### mbstring.encoding_translation
- **説明:** `mbstring.internal_encoding` 設定に従って自動エンコーディング変換を有効にします。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.encoding_translation = Off`
#### mbstring.detect_order
- **説明:** 自動エンコーディング検出の順序を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.detect_order = auto`
#### mbstring.substitute_character
- **説明:** 文字の変換に失敗した際に使用される代替キャラクタを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.substitute_character = none`
#### mbstring.strict_detection
- **説明:** 厳密なエンコーディング検出を有効にします。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.strict_detection = Off`
#### mbstring.http_output_conv_mimetypes
- **説明:** `mb_output_handler()` がアクティブになるコンテンツタイプの正規表現パターンを設定します。
- **設定例:** コメントアウトされています。
#### mbstring.regex_stack_limit
- **説明:** mbstring 正規表現の最大スタック深度を指定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.regex_stack_limit = 100000`
#### mbstring.regex_retry_limit
- **説明:** mbstring 正規表現の最大リトライ回数を指定します。
- **設定例:** コメントアウトされていますが、使用する場合は `mbstring.regex_retry_limit = 1000000`
### GD セクション
#### gd.jpeg_ignore_warning
- **説明:** JPEGのデコード時に警告を無視して GD 画像を作成するかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `gd.jpeg_ignore_warning = 1`
### Exif セクション
#### exif.encode_unicode
- **説明:** ExifのUNICODEユーザコメントをエンコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.encode_unicode = ISO-8859-15`
#### exif.decode_unicode_motorola
- **説明:** Motorolaバイト順でエンコードされたExifのUNICODEをデコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.decode_unicode_motorola = UCS-2BE`
#### exif.decode_unicode_intel
- **説明:** Intelバイト順でエンコードされたExifのUNICODEをデコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.decode_unicode_intel = UCS-2LE`
#### exif.encode_jis
- **説明:** ExifのJISユーザコメントをエンコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.encode_jis = JIS`
#### exif.decode_jis_motorola
- **説明:** Motorolaバイト順でエンコードされたExifのJISをデコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.decode_jis_motorola = JIS`
#### exif.decode_jis_intel
- **説明:** Intelバイト順でエンコードされたExifのJISをデコードする形式を設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `exif.decode_jis_intel = JIS`
### Tidy セクション
#### tidy.default_config
- **説明:** 使用するデフォルトのTidy設定ファイルのパスを設定します。
- **設定例:** コメントアウトされています。
#### tidy.clean_output
- **説明:** Tidy が出力を自動的にクリーンアップおよび修正するかどうかを設定します。非HTMLコンテンツを生成する場合は使用しないでください。
- **設定例:** `tidy.clean_output = Off`
### SOAP セクション
#### soap.wsdl_cache_enabled
- **説明:** WSDLキャッシュ機能を有効にするか無効にするかを設定します。
- **設定例:** `soap.wsdl_cache_enabled = 1`
#### soap.wsdl_cache_dir
- **説明:** SOAP拡張機能がキャッシュファイルを保存するディレクトリ名を設定します。
- **設定例:** `soap.wsdl_cache_dir = "/tmp"`
#### soap.wsdl_cache_ttl
- **説明:** キャッシュファイルの有効期限を秒単位で設定します。
- **設定例:** `soap.wsdl_cache_ttl = 86400`(24時間)
#### soap.wsdl_cache_limit
- **説明:** キャッシュできるWSDLファイルの最大数を設定します。
- **設定例:** `soap.wsdl_cache_limit = 5`
### Sysvshm セクション
#### sysvshm.init_mem
- **説明:** 共有メモリセグメントのデフォルトサイズを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `sysvshm.init_mem = 10000`
### LDAP セクション
#### ldap.max_links
- **説明:** 開くことができる最大リンク数を設定します。 `-1` は無制限を意味します。
- **設定例:** `ldap.max_links = -1`
### DBA セクション
#### dba.default_handler
- **説明:** デフォルトのDBAハンドラを設定します。
- **設定例:** コメントアウトされています。
これらの設定は、PHPが提供する特定の機能やモジュール(アサーション、COM、mbstring、gd、exif、Tidy、SOAP、sysvshm、LDAP、DBAなど)の動作を詳細に制御するものです。状況に応じて各設定を適切に行うことで、PHPの動作をカスタマイズし、パフォーマンスやセキュリティを最適化することができます。
質問
回答
以下は、`php.ini` ファイルの行 1780~1966 の解説です。この部分には、Zend OPcache、curl、openssl、FFI(Foreign Function Interface)関連の設定オプションが含まれています。
### OPcache セクション
#### opcache.enable
- **説明:** Zend OPcacheを有効にするかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.enable=1`
#### opcache.enable_cli
- **説明:** CLI版のPHPに対してZend OPcacheを有効にするかどうかを設定します。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.enable_cli=0`
#### opcache.memory_consumption
- **説明:** OPcache共有メモリのストレージサイズを設定します。
- **設定例:** `opcache.memory_consumption=128`
#### opcache.interned_strings_buffer
- **説明:** インターンの文字列のためのメモリバッファサイズをMB単位で設定します。
- **設定例:** `opcache.interned_strings_buffer=8`
#### opcache.max_accelerated_files
- **説明:** OPcacheハッシュテーブルに格納されるキー(スクリプト)の最大数を設定します。200〜1000000の範囲で設定可能です。
- **設定例:** `opcache.max_accelerated_files=10000`
#### opcache.max_wasted_percentage
- **説明:** 再起動がスケジュールされるまでの"無駄"メモリの最大パーセンテージを設定します。
- **設定例:** `opcache.max_wasted_percentage=5`
#### opcache.use_cwd
- **説明:** 現在の作業ディレクトリをスクリプトキーに追加するかどうかを設定します。同名ファイル間の衝突を回避しますが、パフォーマンスに影響します。
- **設定例:** `opcache.use_cwd=1`
#### opcache.validate_timestamps
- **説明:** オフにすると、ファイルシステムの変更を反映するために手動でOPcacheをリセットするか、Webサーバを再起動する必要があります。
- **設定例:** `opcache.validate_timestamps=1`
#### opcache.revalidate_freq
- **説明:** 共有メモリストレージの変更をチェックするためのファイルタイムスタンプをチェックする頻度(秒単位)を設定します。`0`は常に検証します。
- **設定例:** `opcache.revalidate_freq=2`
#### opcache.revalidate_path
- **説明:** インクルード路径の最適化を有効にするかどうかを設定します。
- **設定例:** `opcache.revalidate_path=0`
#### opcache.save_comments
- **説明:** 無効にすると、コードからすべてのPHPDocコメントが削除され、コードのサイズが減少します。
- **設定例:** `opcache.save_comments=1`
#### opcache.record_warnings
- **説明:** コンパイル警告(通知と非推奨警告を含む)を記録し、ファイルが含まれるたびに再生するかどうかを設定します。
- **設定例:** `opcache.record_warnings=0`
#### opcache.enable_file_override
- **説明:** `file_exists` などのパフォーマンス機能を許可するかどうかを設定します。
- **設定例:** `opcache.enable_file_override=0`
#### opcache.optimization_level
- **説明:** ビットマスクであり、各ビットが適切なOPcacheパスの有効化または無効化を制御します。
- **設定例:** `opcache.optimization_level=0x7FFFBFFF`
#### opcache.dups_fix
- **説明:** 重複の修正を有効にするかどうかを設定します。
- **設定例:** コメントアウトされています。
#### opcache.blacklist_filename
- **説明:** OPcacheのブラックリストファイルの位置を設定します。ワイルドカードが許可されています。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.blacklist_filename=/path/to/blacklist.txt`
#### opcache.max_file_size
- **説明:** キャッシュから除外される大きなファイルのサイズを設定します。デフォルトですべてのファイルがキャッシュされます。
- **設定例:** `opcache.max_file_size=0`
#### opcache.force_restart_timeout
- **説明:** キャッシュがアクセスされていない場合にスケジュールされた再起動が開始されるまでの待機時間を秒単位で設定します。
- **設定例:** `opcache.force_restart_timeout=180`
#### opcache.error_log
- **説明:** OPcacheのエラーログファイル名を設定します。空の文字列は "stderr" を意味します。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.error_log=/path/to/error.log`
#### opcache.log_verbosity_level
- **説明:** OPcacheエラーの詳細レベルを設定します。デフォルトは1(エラーのみ)です。
- **設定例:** `opcache.log_verbosity_level=1`
#### opcache.preferred_memory_model
- **説明:** 推奨共有メモリバックエンドを設定します。空白にしてシステムに決定させます。
- **設定例:** コメントアウトされています。
#### opcache.protect_memory
- **説明:** スクリプト実行中の共有メモリの予期しない書き込みから保護します。内部デバッグのみのために使用します。
- **設定例:** `opcache.protect_memory=0`
#### opcache.restrict_api
- **説明:** 特定のディレクトリ経由でのみOPcache API関数を呼び出すことを許可します。デフォルトは""で制限なしです。
- **設定例:** コメントアウトされています。
#### opcache.file_cache
- **説明:** 2次キャッシュディレクトリを有効にします。ファイルベースのキャッシュを使用する場合はパフォーマンスが向上します。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.file_cache=/path/to/cache`
#### opcache.file_cache_only
- **説明:** 共有メモリ内でのopcodeキャッシュを無効にして、ファイルキャッシュのみを使用するかどうかを設定します。
- **設定例:** `opcache.file_cache_only=0`
#### opcache.file_cache_consistency_checks
- **説明:** ファイルキャッシュから読み込まれたスクリプトのチェックサム検証を有効にするかどうかを設定します。
- **設定例:** `opcache.file_cache_consistency_checks=1`
#### opcache.file_cache_fallback
- **説明:** ファイルキャッシュが明示的に有効になっている場合、共有メモリに再アタッチできなかった場合にファイルキャッシュのみを使用するかどうかを設定します。
- **設定例:** `opcache.file_cache_fallback=1`
#### opcache.huge_code_pages
- **説明:** PHPコード(テキストセグメント)をHUGE PAGESにコピーするかどうかを設定します。特定の条件下でパフォーマンスが向上しますが、初期化が遅延し、メモリ使用量が増加します。
- **設定例:** `opcache.huge_code_pages=0`
#### opcache.validate_permission
- **説明:** キャッシュされたファイルの権限を検証するかどうかを設定します。
- **設定例:** `opcache.validate_permission=0`
#### opcache.validate_root
- **説明:** chroot環境での名前の衝突を防ぐために検証します。
- **設定例:** `opcache.validate_root=0`
#### opcache.opt_debug_level
- **説明:** 最適化の異なる段階のデバッグのためのオプコードダンプを生成します。
- **設定例:** `opcache.opt_debug_level=0`
#### opcache.preload
- **説明:** サーバー起動時にコンパイルおよび実行されるPHPスクリプトを指定します。
- **設定例:** コメントアウトされていますが、使用する場合は `opcache.preload=/path/to/preload.php`
#### opcache.preload_user
- **説明:** セキュリティ上の理由からrootとしてのコードのプリロードを許可しないように、特定のユーザーとしてプリロードを実行するように指定します。
- **設定例:** コメントアウトされています。
#### opcache.file_update_protection
- **説明:** 更新されたファイルが不完全な状態でキャッシュされないようにするための設定です。サイトのすべてのファイル更新がアトミックである場合、この設定を0にすることでパフォーマンスが向上します。
- **設定例:** `opcache.file_update_protection=2`
#### opcache.lockfile_path
- **説明:** 共有ロックファイルを格納するための絶対パスを設定します(*nixのみ)。
- **設定例:** `opcache.lockfile_path=/tmp`
### curl セクション
#### curl.cainfo
- **説明:** `CURLOPT_CAINFO` オプションのデフォルト値を設定します。これは絶対パスである必要があります。
- **設定例:** コメントアウトされていますが、使用する場合は `curl.cainfo=/path/to/cacert.pem`
### openssl セクション
#### openssl.cafile
- **説明:** SSL/TLSピアのIDを検証する際に使用するCAファイルの位置を設定します。ほとんどのユーザーは設定しなくてもOS管理の証明書ストアが使用されます。
- **設定例:** コメントアウトされていますが、使用する場合は `openssl.cafile=/path/to/ca-bundle.crt`
#### openssl.capath
- **説明:** CAファイルが見つからない場合に検索するディレクトリを設定します。ほとんどのユーザーは設定しなくてもOS管理の証明書ストアが使用されます。
- **設定例:** コメントアウトされていますが、使用する場合は `openssl.capath=/path/to/certs`
### FFI(Foreign Function Interface)セクション
#### ffi.enable
- **説明:** FFI API を有効にするかどうかを設定します。
- **設定例:** `ffi.enable=preload`
#### ffi.preload
- **説明:** プリロードするヘッダーファイルのリストを指定します。ワイルドカードパターンが許可されています。
- **設定例:** コメントアウトされていますが、使用する場合は `ffi.preload="/path/to/header.h"`
これらの設定は、PHPのキャッシュ、SSL/TLS検証、およびFFIに関連した機能の動作を詳細に制御するためのものです。それぞれの設定を適切に調整することで、パフォーマンスやセキュリティを最適化できます。