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 — Abrir conexión con el servidor Informix
Descripción
$database
[, string $userid
[, string $password
]]] )ifx_connect() establece una conexión con un servidor Informix.
En este caso se hace una segunda llamada a ifx_connect() con los mismos argumentos, no se abrirá nuevo enlace, pero en su lugar. El identificador de enlace ya abierto será devuelto.
El enlace al servidor será cerrado tan pronto como la ejecución del script termine, a menos que sea cerrado llamando a explícitamente a ifx_close().
Parámetros
Todos los argumentos son opcionales, y si alguno falta, por defecto se toman los valores proporcionados en el php.ini (ifx.default_host para el host (La libreria usará el valor de entorno INFORMIXSERVER si no está definido), ifx.default_user para el usuario, ifx.default_password para la contraseña (ninguna si no está definida).
-
database -
El nombre de la base de datos, como un string.
-
userid -
El usuario, como un string.
-
password -
La contraseña, como un string.
Valores devueltos
Devuelve un identificador de conexión en caso de éxito, o FALSE en caso de error.
Ejemplos
Ejemplo #1 Conectarse a una base de datos Informix
<?php
$conn_id = ifx_connect ("mydb@ol_srv1", "imyself", "mypassword");
?>
Ver también
- ifx_pconnect() - Open persistent Informix connection
- ifx_close() - Cerrar conexión Informix
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!
