PHP 8.3.4 Released!

実行時設定

php.ini の設定により動作が変化します。

ibm_db2 設定オプション
名前 デフォルト 変更可能 変更履歴
ibm_db2.binmode "1" INI_ALL  
ibm_db2.i5_all_pconnect "0" INI_SYSTEM ibm_db2 1.6.5 以降で利用可能
ibm_db2.i5_allow_commit "0" INI_SYSTEM ibm_db2 1.4.9 以降で利用可能
ibm_db2.i5_blank_userid "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_char_trim "0" INI_SYSTEM ibm_db2 2.1.0 以降で利用可能
ibm_db2.i5_dbcs_alloc "0" INI_SYSTEM ibm_db2 1.5.0 以降で利用可能
ibm_db2.i5_guard_profile "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_ignore_userid "0" INI_SYSTEM ibm_db2 1.8.0 以降で利用可能
ibm_db2.i5_job_sort "0" INI_SYSTEM ibm_db2 1.8.4 以降で利用可能
ibm_db2.i5_log_verbose "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_max_pconnect "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_override_ccsid "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_servermode_subsystem NULL INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.i5_sys_naming "0" INI_SYSTEM ibm_db2 1.9.7 以降で利用可能
ibm_db2.instance_name NULL INI_SYSTEM ibm_db2 1.0.2 以降で利用可能

以下に設定ディレクティブに関する 簡単な説明を示します。

ibm_db2.binmode int

このオプションは、バイナリデータを PHP アプリケーションで 使用する際のモードを制御します。

  • 1 (DB2_BINARY)

  • 2 (DB2_CONVERT)

  • 3 (DB2_PASSTHRU)

ibm_db2.i5_all_pconnect int

このオプションは、IBM i 上での接続を強制的にすべて持続的接続にします。 基本的に、すべての db2_connect() 関数のコールは透過的に db2_pconnect() のコールになります。 デフォルトでは、このオプションの値は 0 です。 このオプションは、持続的接続が高速な場合のために便宜上提供されています。 新しいアプリケーションでは、このオプションを使うべきではありません。

  • 0 - 持続的接続、およびそうでない接続の両方を作成できます

  • 1 - すべての接続を持続的接続にします

ibm_db2.i5_allow_commit int

このオプションは、トランザクションの分離レベルを制御します。 デフォルトでは、このオプションの値は 0 です。 よって、コミットの制御は使いません。 このオプションは、配列のキー i5_commit を接続オプションの配列に設定し、 db2_connect()db2_pconnect() に渡すことで上書きできます。

  • 0 - コミット制御を使いません。

  • 1 - read uncommitted。ダーティリードの可能性があります。

  • 2 - read committed。ダーティリードは発生しません。

  • 3 - repeatable read。ダーティリードや非再現リードは発生しません。

  • 4 - serializeable。ダーティリードや非再現リードやファントムリードは発生しません。

ibm_db2.i5_blank_userid int

IBM i 上で空のユーザーIDを許可すべきかどうかを制御します。 デフォルトでは、このオプションの値は 0 です。 ibm_db2.i5_ignore_userid と異なり、 このオプションはすべてのユーザーIDを強制的に空にしたり、 ジョブの振る舞いを変えたりはしません。 ただ単に、Db2 に現在のユーザーとしてする際、 空のユーザーIDを渡すことを許可するだけです。

  • 0 - ユーザーIDを空で渡すことを許可しません

  • 1 - ユーザーIDを空で渡すことを許可します。

ibm_db2.i5_char_trim int

このオプションは、IBM i における文字列の右端をトリム処理するかを制御します。 多くのテーブルは固定のカラムサイズを持ち、スペースで埋められているため、 このオプションが便宜のため提供されています。 デフォルトでは、このオプションの値は 0 です。

  • 0 - カラムの値はトリム処理されません。

  • 1 - 返される文字カラムの右端のスペースが削除されます。

ibm_db2.i5_dbcs_alloc int

This options affects the internal buffer allocation strategy on IBM i. By default, this option is 0. When this option is set, buffers are allocated with a much larger size, in case the database underestimates a string's size when converting between encodings. This option uses six times as much memory for buffers (to account for the largest possible UTF-8 sequences), but may be needed if truncated data is returned.

  • 0 - Minimum size buffers are allocated.

  • 1 - Larger size buffers are allocated.

ibm_db2.i5_guard_profile int

IBM i 上のデータベースに持続的接続する際、 ユーザーのデータベースのプロファイルを切り替えるかどうかをチェックします。 切り替える場合、データベースから切断します。 デフォルトでは、このオプションの値は 0 です。

  • 0 - プロファイルの切換をチェックしません

  • 1 - プロファイルの切換をチェックし、切り替える場合は切断します

ibm_db2.i5_log_verbose int

This option sets if SQL diagnostic messages like warnings and errors are always sent to the PHP error log on IBM i. Normally, only a brief message on failure is sent (such as "statement execute failed") to the PHP error log, as this option is set to 0 by default. Note that you can still and should call i.e. db2_stmt_errormsg() manually as part of checking if functions fail.

  • 0 - Only logs brief messages.

  • 1 - Logs the SQL diagnostic message in addition to the brief message.

ibm_db2.i5_ignore_userid int

IBM i 上で実行される際、かつデータベースに接続する際に、 このオプションはユーザーID を無視します。 また、別々のジョブではなく、PHPジョブの内部でSQL/CLI の機能を実行します。 デフォルトでは、このオプションの値は 0 です。 このオプションを有効にすると、 別々のデータベースサーバのジョブを使わず、 常に現在のユーザープロファイルを使います。 そして、db2_connect()db2_pconnect() に渡されるユーザー名とパスワードを無視します。

  • 0 - 指定されたクレデンシャルを使い、SQL/CLI サーバのジョブを使います。

  • 1 - 常に空のクレデンシャルを使い、PHP のジョブ中でSQL/CLI ジョブを実行します

ibm_db2.i5_job_sort int

IBM i におけるジョブソートを制御します。 デフォルトでは、このオプションの値は 0 です。 これは IBM i SQL/CLI の SQL_ATTR_CONN_SORT_SEQUENCE 属性に対応します。

  • 0 - *HEX ソートオプションを使い、 バイト単位でソートを行います。

  • 1 - PHP のジョブ向けにジョブソートのシーケンスを使います。

  • 2 - データベースのジョブ向けにジョブソートのシーケンスを使います。

ibm_db2.i5_max_pconnect int

このオプションは、IBM i 上で実行する際、 何回持続的接続が再利用されるかに影響します。 デフォルトでは、この値は 0 です。 つまり、持続的接続は常に再利用されるということです。 このオプションは、 長時間実行されるデータベースのジョブで起こる問題 (つまり、プロシージャでメモリリークが起きた場合など) を回避されるのに役立ちますが、明らかに長期的に役立つものではないでしょう。

ibm_db2.i5_override_ccsid int

The PASE CCSID to use for character conversions from EBCDIC on IBM i. By default, this is 0, which will select the default PASE job CCSID, which comes from the PASE locale settings. For example, setting this to 1208 will use UTF-8. This should only be modified if the PASE job CCSID isn't the expected CCSID, and the locale cannot be modified.

To learn more about CCSIDs on IBM i, consult the » IBM documentation. To learn how locales on IBM i PASE are mapped to CCSIDs, consult the » IBM documentation.

ibm_db2.i5_sys_naming int

This option controls the naming mode when connecting to an IBM i system. By default, this option is 0. The naming mode affects how names are resolved and the allowed syntax for names. When set to 0, this uses periods to qualify names and uses the default library or user ID to resolve names. When set to 1, this uses slashes to qualify names and uses the job library list to resolve names.

  • 0 - Uses the SQL naming mode ("SCHEMA.TABLE").

  • 1 - Uses the system naming mode ("LIBRARY/FILE").

To learn more about naming modes on IBM i, consult the » IBM documentation.

ibm_db2.i5_servermode-subsystem string

This option changes which subsystem database server jobs run under on IBM i. By default, this option is null, so jobs will run under the default subsystem for QSQSRVR jobs.

ibm_db2.instance_name string

Linux や UNIX オペレーティングシステムにおいて、 このオプションはカタログされたデータベースへの接続で使う、 インスタンス名を定義します。 デフォルトでは、このオプションの値は null です。 このオプションを設定すると、 環境変数 DB2INSTANCE の値を上書きします。

Windows では、このオプションの値は無視されます。

add a note

User Contributed Notes 2 notes

up
1
yoshida at zend dot co dot jp
13 years ago
The explanation of ibm_db2.i5_dbcs_alloc seems to be hard to understand for me.

In ibm_db2 extension inside, 6 times length of string column is allocated if i5_dbcs_alloc value is 1.
The allocated area is used for conversion between UTF-8 and EBCDIC character encodings.

By the definition of UTF-8, letter length can need 6 bytes at the maximum.

Note:
In the case of a long column, allocated size may be beyond the upper limit defined in DB2 because original column is made by 6 times. It can cause result data becomes null.
up
0
Satoru Yoshida
11 years ago
The explanation of ibm_db2.i5_allow_commit seems to be slightly difficult to understand for me.

I think it would be better to replace "no commit" with "can not use commitment control" or "do not allow transaction", and "allow commit" would be changed into
"can use commitment control" or "allow transaction" , Thanks.
To Top