Hi
Trying to setup an informix connection to our existing informix 9 server using apache/php. Any help would be greatly appreciated. Error message is:
Warning: ifx_pconnect(): E [SQLSTATE=IX 000 SQLCODE=-25596] in /www/ifx.php on line 13
Unable to connect to Informix database
Informix error: E [SQLSTATE=IX 000 SQLCODE=-25596]
The INFORMIXSERVER value is not listed in the sqlhosts file or the Registry.
************************************************** ****
<?php
$database = "authtest";
$server = "sun450";
$login = "informix";
$password = "password";
$dbs = $database . "@" . $server;
$connect_id = ifx_pconnect($dbs,$login,$password);
if (!$connect_id) {
echo "Unable to connect to Informix database<br>\n";
chk_ifx_err1($connect_id);
} else {
echo "Informix connection successful! <BR>";
}
************************************************** *****
/opt/informix/etc/sqlhosts
authlive ontlitcp sun450 sqlexec1
authlive_shm onipcshm sun450 authlive
authtest ontlitcp sun450 sqlexec2
authtest_shm onipcshm sun450 authtest
authconv ontlitcp sun450 sqlexec3
authconv_shm onipcshm sun450 authconv
authdemo ontlitcp sun450 sqlexec4
authdemo_shm onipcshm sun450 authdemo
************************************************** *****
/etc/services
sqlexec1 1541/tcp # authlive
sqlexec2 1542/tcp # authtest
sqlexec3 1543/tcp # authconv
sqlexec4 1544/tcp # authdemo
************************************************** *****
/home/apache_user/.bash_profile (environment variables)
INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts
export INFORMIXSQLHOSTS
INFORMIXDIR=/opt/informix
export INFORMIXDIR
INFORMIXSERVER=sun450
export INFORMIXSERVER
PATH=$PATH:$INFORMIXDIR/bin
export PATH
LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql
export LD_LIBRARY_PATH