Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Unanswered: 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.

  2. #2
    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

  3. #3
    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?

  4. #4
    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

  5. #5
    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.

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •