Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Argentina
    Posts
    58

    Unanswered: php firebird connection problem

    Hi, I get the following error trying to conect to firebird db.

    Code:
    Warning: ibase_connect() [function.ibase-connect]: Unable to complete network request to host "10.10.5.61". Failed to locate host machine. Undefined service gds_db/tcp. in c:\Inetpub\wwwroot\fire\inc.php on line 17
    Could not connect: Unable to complete network request to host "10.10.5.61". Failed to locate host machine. Undefined service gds_db/tcp.
    Is PHP5 and IIS in win xp.

    I copied the database to c:\DB\ and to c:\Inetpub\wwwroot\fire\db\

    My code is:
    Code:
    //$strconnect = '10.10.5.61:\db\TEST2.GDB';
    	//$strconnect = '10.10.5.61:c:\db\TEST2.GDB';
    	//$strconnect = '10.10.5.61:.\db\TEST2.GDB';
    	$strconnect = '10.10.5.61:./db/TEST2.GDB';
    	
    	if (!($db=ibase_connect($strconnect, 'sysdba', 'masterkey', 'ISO8859_1', 0, 1)))
       		die('Could not connect: ' .  ibase_errmsg());
    
    	  $sql  = "SELECT * FROM TABLE1";
    	  $rid = @ibase_query ($db, $sql);
    	  $row_array = ibase_fetch_row($cursor);
      
    	  print_r($row_array);
    
    	  ibase_free_result($cursor);
    	  ibase_close($db);
    I tried all for options of $strconnect

    I added the line
    gds_db/tcp 3050/tcp #Firebird
    to the c:\WINDOWS\system32\drivers\etc\services file
    Last edited by diegolaz; 10-20-05 at 10:53.

  2. #2
    Join Date
    Jun 2014
    Posts
    2

    ibase_connect()

    unable to connect to localhost.. using xampp on xp.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    and your connection string/parameters are?
    have you proved that the dbserver is active and accepting connections
    have you checked the user id and password is correct
    have you rproved the permissions are OK
    which db are you trying to connect to?
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jun 2014
    Posts
    2

    .

    Below is the code:
    <?php
    $host = 'localhost:C:/database/EMPLOYEE.GDB';
    $username='SYSDBA';
    $password='MASTERKEY';

    $dbh = ibase_connect ( $host, $username, $password ) or die ("error in db connect");
    $stmt="Select * from SHOW_LANGS('SRep',4,'Italy')";
    $query = ibase_prepare($stmt);
    $rs=ibase_execute($query);
    $row = ibase_fetch_row($rs);

    echo $row[0];

    /* free result */
    ibase_free_query($query);
    ibase_free_result($rs);

    /* close db */
    ibase_close($dbh);
    ?>

    Error message:
    Warning: ibase_connect(): Unable to complete network request to host "localhost". Failed to establish a connection. in C:\xampp\htdocs\xampp\interbase5.php on line 6
    error in db connect

    same query in isql:
    Select * from SHOW_LANGS('SRep',4,'Italy')

    LANGUAGES
    ===============

    Italian

    German

    French

    PHP Version 5.4.27
    Apache 2.0

    db:interbase
    Path Name = C:\WINDOWS\system32\gds32.dll
    Version = 5.6.0.29

Posting Permissions

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