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 — Ouvre une connexion à un serveur Informix
Description
$database
[, string $userid
[, string $password
]]] )ifx_connect() établit une connexion à un serveur Informix.
Si un deuxième appel à ifx_connect() est fait avec les mêmes arguments, l'identifiant de connexion déjà ouvert sera retourné.
Le lien avec le serveur sera fermé dès que le script se termine, ce qui fait qu'il n'est pas nécessaire de terminer les connexions avec ifx_close().
Liste de paramètres
Tous les arguments sont optionnels, et, s'ils viennent à manquer, les valeurs par défaut seront prises dans le php.ini (ifx.default_host pour l'hôte par défaut) (Les bibliothèques Informix utiliseront la variable d'environnement $INFORMIXSERVER si ifx.default_host n'est pas définie). ifx.default_user pour l'utilisateur, et ifx.default_password comme mot de passe (si aucun n'a été défini).
-
database -
Le nom de la base de données, sous la forme d'une chaîne de caractères.
-
userid -
Le nom d'utilisateur, sous la forme d'une chaîne de caractères.
-
password -
Le mot de passe, sous la forme d'une chaîne de caractères.
Valeurs de retour
Retourne un identifiant de connexion en cas de succès, ou
FALSE si une erreur survient.
Exemples
Exemple #1 Connexion à un serveur Informix
<?php
$conn_id = ifx_connect ("mydb@ol_srv1", "imyself", "mypassword");
?>
Voir aussi
- ifx_pconnect() - Ouvre une connexion persistante à un serveur Informix
- ifx_close() - Ferme une connexion à un serveur 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!
