If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Error connecting to Informix Database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-06, 17:29
tgledhill tgledhill is offline
Registered User
 
Join Date: Jan 2006
Posts: 3
Error connecting to Informix Database

I compiled PHP with the informix client sdk mod to allow me to connect to an Informix database using php commands. Everytime I try to connect though I get an error and I have no idea what the error is referring too. Here is the code and error.

$conn_id = ifx_connect ("XXX.XXX.XXX.XXX", "user", "password");

<b>Warning</b>: ifx_connect(): E [SQLSTATE=IX 000 SQLCODE=-25553] in <b>/home/tgledhill/test.php</b> on line <b>2</b><br />

Any idea what is causing this? And what needs to be done to fix it?

I'm willing to pay someone to help me fix this.
Reply With Quote
  #2 (permalink)  
Old 02-01-06, 17:53
John Grubb John Grubb is offline
Registered User
 
Join Date: Jan 2006
Posts: 27
The Error:

Sqlhosts file not found or cannot be opened.

The sqlhosts file is required to determine information to establish connection to a local or remote server. Create an sqlhosts file in the directory $INFORMIXDIR/etc according to the format that the manual for your database server product describes.

It's most likely a misconfigured environment or permissions issue. You do have the Informix client installed on the php machine?

Jay Grubb
Technical Consultant
OpenLink Software
Web: http://www.openlinksw.com:
Product Weblogs:
Virtuoso: http://www.openlinksw.com/weblogs/virtuoso
UDA: http://www.openlinksw.com/weblogs/uda
Universal Data Access & Virtual Database Technology Providers
Reply With Quote
  #3 (permalink)  
Old 02-01-06, 19:02
tgledhill tgledhill is offline
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks Jay!

Now I've progressed to another error:
INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES.

My environment variable is set to:
INFORMIXSERVER="inf"

And my sqlhosts file contains:
inf onsoctcp 10.x.x.x informix

I've even tried setting onconfig with the DBSERVERNAME to no avail. Any ideas?
Reply With Quote
  #4 (permalink)  
Old 02-02-06, 09:40
John Grubb John Grubb is offline
Registered User
 
Join Date: Jan 2006
Posts: 27
Have you set $INFORMIXDIR?

Is the sqlhosts file in $INFORMIXDIR/etc/sqlhosts?

Also be sure that 'informix' is in the /etc/services file, and it matches the value set on the server.

$ONCONFIG is really for the informix server, to specify which informix config to use on startup. Shouldn't need it set for the client, and it points to a file anyway, not a value.

Jay Grubb
Technical Consultant
OpenLink Software
Web: http://www.openlinksw.com:
Product Weblogs:
Virtuoso: http://www.openlinksw.com/weblogs/virtuoso
UDA: http://www.openlinksw.com/weblogs/uda
Universal Data Access & Virtual Database Technology Providers
Reply With Quote
  #5 (permalink)  
Old 02-02-06, 12:39
tgledhill tgledhill is offline
Registered User
 
Join Date: Jan 2006
Posts: 3
All those are set correctly. Could this be something out of sync with the server? It appears that I am able to login, because if I change the username or password, I get a different error message.
Reply With Quote
  #6 (permalink)  
Old 02-03-06, 17:21
John Grubb John Grubb is offline
Registered User
 
Join Date: Jan 2006
Posts: 27
What's the different error?

Also, are you running the script from the commandline, or from within an appserver? For example, Apache can be setup to override environment settings.

Silly question, but you havene't explicitely stated you've installed the Informix sdk, just 'PHP with the informix client sdk mod', which might not do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On