Laufzeit-Konfiguration
Das Verhalten dieser Funktionen wird durch Einstellungen in der php.ini beeinflusst.
Hinweis:
Make sure that the Informix environment variables INFORMIXDIR and INFORMIXSERVER are available to the PHP ifx driver, and that the INFORMIX bin directory is in the PATH. Check this by running a script that contains a call to phpinfo() before you start testing. The phpinfo() output should list these environment variables. This is true for both CGI php and Apache mod_php. You may have to set these environment variables in your Apache startup script.
The Informix shared libraries should also be available to the loader (check LD_LIBRARY_PATH or ld.so.conf/ldconfig).
Hinweis: Some notes on the use of BLOBs (TEXT and BYTE columns)
BLOBs are normally addressed by BLOB identifiers. Select queries return a "blob id" for every BYTE and TEXT column. You can get at the contents with "string_var = ifx_get_blob($blob_id);" if you choose to get the BLOBs in memory (with: "ifx_blobinfile(0);"). If you prefer to receive the content of BLOB columns in a file, use "ifx_blobinfile(1);", and "ifx_get_blob($blob_id);" will get you the filename. Use normal file I/O to get at the blob contents.
For insert/update queries you must create these "blob id's" yourself with "ifx_create_blob();". You then plug the blob id's into an array, and replace the blob columns with a question mark (?) in the query string. For updates/inserts, you are responsible for setting the blob contents with ifx_update_blob().
The behaviour of BLOB columns can be altered by configuration variables that also can be set at runtime:
configuration variable: ifx.textasvarchar
configuration variable: ifx.byteasvarchar
runtime functions:
ifx_textasvarchar(0): use blob id's for select queries with TEXT columns
ifx_byteasvarchar(0): use blob id's for select queries with BYTE columns
ifx_textasvarchar(1): return TEXT columns as if they were VARCHAR columns, so that you don't need to use blob id's for select queries.
ifx_byteasvarchar(1): return BYTE columns as if they were VARCHAR columns, so that you don't need to use blob id's for select queries.
configuration variable: ifx.blobinfile
runtime function:
ifx_blobinfile_mode(0): return BYTE columns in memory, the blob id lets you get at the contents.
ifx_blobinfile_mode(1): return BYTE columns in a file, the blob id lets you get at the file name.
If you set ifx_text/byteasvarchar to 1, you can use TEXT and BYTE columns in select queries just like normal (but rather long) VARCHAR fields. Since all strings are "counted" in PHP, this remains "binary safe". It is up to you to handle this correctly. The returned data can contain anything, you are responsible for the contents.
If you set ifx_blobinfile to 1, use the file name returned by ifx_get_blob(..) to get at the blob contents. Note that in this case YOU ARE RESPONSIBLE FOR DELETING THE TEMPORARY FILES CREATED BY INFORMIX when fetching the row. Every new row fetched will create new temporary files for every BYTE column.
The location of the temporary files can be influenced by the environment variable "blobdir", default is "." (the current directory). Something like: putenv(blobdir=tmpblob"); will ease the cleaning up of temp files accidentally left behind (their names all start with "blb").
Hinweis: Automatically trimming "char" (SQLCHAR and SQLNCHAR) data
This can be set with the configuration variable
ifx.charasvarchar: if set to 1 trailing spaces will be automatically trimmed, to save you some "chopping".
Hinweis:
NULL
values
The configuration variable ifx.nullformat (and the runtime function ifx_nullformat()) when set to
TRUE
will returnNULL
columns as the string "NULL
", when set toFALSE
they return the empty string. This allows you to discriminate betweenNULL
columns and empty columns.
Name | Standard | Veränderbar | Changelog |
---|---|---|---|
ifx.allow_persistent | "1" | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.max_persistent | "-1" | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.max_links | "-1" | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.default_host | NULL | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.default_user | NULL | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.default_password | NULL | PHP_INI_SYSTEM | Removed in PHP 5.2.1. |
ifx.blobinfile | "1" | PHP_INI_ALL | Removed in PHP 5.2.1. |
ifx.textasvarchar | "0" | PHP_INI_ALL | Removed in PHP 5.2.1. |
ifx.byteasvarchar | "0" | PHP_INI_ALL | Removed in PHP 5.2.1. |
ifx.charasvarchar | "0" | PHP_INI_ALL | Removed in PHP 5.2.1. |
ifx.nullformat | "0" | PHP_INI_ALL | Removed in PHP 5.2.1. |
Hier eine kurze Erklärung der Konfigurationsoptionen:
-
ifx.allow_persistent
boolean -
Whether to allow persistent Informix connections.
-
ifx.max_persistent
integer -
The maximum number of persistent Informix connections per process.
-
ifx.max_links
integer -
The maximum number of Informix connections per process, including persistent connections.
-
ifx.default_host
string -
The default host to connect to when no host is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in Safe Mode.
-
ifx.default_user
string -
The default user id to use when none is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in Safe Mode.
-
ifx.default_password
string -
The default password to use when none is specified in ifx_connect() or ifx_pconnect(). Doesn't apply in Safe Mode.
-
ifx.blobinfile
boolean -
Set to
TRUE
if you want to return blob columns in a file,FALSE
if you want them in memory. You can override the setting at runtime with ifx_blobinfile_mode(). -
ifx.textasvarchar
boolean -
Set to
TRUE
if you want to return TEXT columns as normal strings in select statements,FALSE
if you want to use blob id parameters. You can override the setting at runtime with ifx_textasvarchar(). -
ifx.byteasvarchar
boolean -
Set to
TRUE
if you want to return BYTE columns as normal strings in select queries,FALSE
if you want to use blob id parameters. You can override the setting at runtime with ifx_textasvarchar(). -
ifx.charasvarchar
boolean -
Set to
TRUE
if you want to trim trailing spaces from CHAR columns when fetching them. -
ifx.nullformat
boolean -
Set to
TRUE
if you want to returnNULL
columns as the literal string "NULL
",FALSE
if you want them returned as the empty string "". You can override this setting at runtime with ifx_nullformat().
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 30/01/2003, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/php-rf-ifx.configuration.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.