Here's a tip :
When i first installed the informix through the removing the ; at php_ifx.dll and then restarted apache
then checking the phpinfo(); the connection wasn't established and i had this error that i have to set the INFORMIXSERVER.
Work Frame : Windows XP,Apache 2.2.1 php 5.3 The ODBC was working fine and i could connect to the informix server using the odbc connection
The problem is that the sql engine was on another machine with different platform.
[SOLUTION]
add an environmental variable called INFORMIXSERVER with the value of the server e.g myInformixServer which itself has an ip 192.x.x.x
You can do that on windows by right click on my computer advanced >> environmental variables >> add new System variable >> variable name = INFORMIXSERVER
variable value = myInformixServer
it worked like a charm
ifx_connect
(PHP 4, PHP <=5.2.0)
ifx_connect — Informix サーバーへの接続をオープンする
説明
resource ifx_connect
([ string
$database
[, string $userid
[, string $password
]]] )ifx_connect() は、Informix サーバーへの接続を確立します。
同じ引数で ifx_connect() を 2 回目にコールした際には、 新規のリンクは確立されず、代わりに既にオープンされたリンクの リンク ID が返されます。
サーバーへのリンクは、ifx_close() のコールに より明示的に事前に閉じない限り、スクリプトの実行終了直後に閉じられます。
パラメータ
全ての引数はオプションであり、指定されない場合には、 設定ファイルにて指定された値 がデフォルト値として設定されます。 (ホストに関して ifx.default_host (定義されていない場合、Informix ライブラリは、環境変数INFORMIXSERVERを参照します) , ユーザーに関して ifx.default_user, パスワードに関して ifx.default_password (定義されていない場合は無し) となります。
-
database -
データベース名を表す文字列。
-
userid -
ユーザー名を表す文字列。
-
password -
パスワードを表す文字列。
返り値
成功時に接続 ID を、エラー時に FALSE を返します。
例
例1 Informix データベースへの接続
<?php
$conn_id = ifx_connect ("mydb@ol_srv1", "imyself", "mypassword");
?>
mohd dot chehab at e-medlinks dot com
31-Mar-2011 03:57
bernd dot newman at t-online dot de
11-Apr-2003 03:00
Problem with INFORMIX-Access with PHP4, WIN NT 4.0?
1. php.ini: extension=php_ifx.dll
2. Path: Informix/BIN
3. httpd.conf: PassEnv INFORMIXSERVER
PassEnv INFORMIXDIR
4. use the Informix-tool regcopy.exe to copy the registry settings in the system-account.
good luck!
