0

I have a database file: laboratoire.GDB.

My goal is to connect to this database and get informations.

I have installed WAMP (Windows, Apache web server, Mysql server and PHP) and enabled the extension of firebird and interbase.

When i try to connect to database, I get the following error message:

(ibase_connect(): Unable to complete network request to host "localhost". Failed to establish a connection. in C:\wamp\www\teste.php on line ...)

Here is my code:

$host = "localhost:C:\wamp\www\laboratoire.GDB";
$username="SYSDBA";
$password="masterkey";
$dbh = ibase_connect($host, $username, $password);
3
  • $host = "localhost:C:\wamp\www\laboratoire.GDB"; $username="SYSDBA";$password="masterkey"; $dbh = ibase_connect($host, $username, $password); Commented Nov 11, 2018 at 14:36
  • 1
    please edit your question instead of adding comments. and use the format as code { } icon to make your code more legible. Commented Nov 11, 2018 at 16:26
  • You need to also install Interbase or Firebird server, depending on the database format. Try FirstAID tool to detect the version of the database file format (so called ODS) to determine if you need FB or IB server to read it. ib-aid.com/en/ibsurgeon-firstaid Commented Nov 12, 2018 at 9:20

1 Answer 1

1

You said you installed MySQL Server. You also said you try to read database file with GDB extension. But that is not MySQL database and your MySQL/MariaDB server can not read it.

GDB extension is typical for Firebird/Interbase/Yaffil/Fyracle/RedDataBase family of servers. So you have to install one of those to read the file. Assuming it is that format and not some another (for example Windows XP uses GDB extension for their own purposes, maybe other software too - http://www.firebirdfaq.org/faq353/ ).

First check is to use IB FirstAid to try and open your DB file. If it will open - you would have to check database format (so called ODS) to see which server you need to install.

Run FirstAid, open the database, press "Direct Diagnostic" button and on "Direct Fix" tab find text like

12:48:17 INFO: Running procedure: Header page check
12:48:17 INFO: ODS Major = 11 (32779)
12:48:17 INFO: ODS Minor = 1

Firebird marker is 32779 = 11+32768, Interbase marker would be zero difference.

You can also check ODS in IBExpert Trial under Tools / Database Inside menu

If the file would be opened, then you need to determine if your file belong to Firebird or Interbase family, other flavors are very rare. However if despite the name this filename has nothing to do with FB/IB family - then you would have to determine what real format is.

Assuming you learned ODS and you checked that is Firebird's ODS not Interbase's ODS the next junction would be:

  • ODS 12 => Firebird 3.x
  • ODS 11.x => Firebird 2.5.x
  • ODS 10.x => Firebird 1.x or 2.x.x of exactly the same bitness and endianess.

See http://www.firebirdfaq.org/faq125/

Whether FirstAID would show your file is of Interbase not Firebird family - you would have to refer to Interbase documentation to select and install proper server version.

Sign up to request clarification or add additional context in comments.

7 Comments

Hello, Thanks a lot for your answer I want just to comment your first part of answer ; if i install mysql server , ican't read GDB file ? in wamp servser or easyphp , it's an extension to read firebird files and interbase and in php it's functions to read interbase databases ( GDB) php.net/manual/en/book.ibase.php so please tell me , i can't open this GDB file with wamp /easyphp wich are mysql servers ?
it's an extension to read firebird files / Never! It is an extension to connect to Interbase or Firebird server. PHP does not "read files" of neither database format. PHP connects to servers. Servers read their own files. MySQL does not read Firebird files. Firebird does not read modern Interbase files. Interbase does not read Oracle files. Oracle does not read DB2 files. DB2 does not read MySQL files. etc. PHP does not read any of those but have libraries to connect to those servers (if they are installed, run and network-connected) and beg them to read files and pass the data to PHP.
with wamp /easyphp wich are mysql servers - no they are not. Windows is not Wordpad. // php.net/manual/en/ibase.installation.php explicitly says which parts of Interbase/Firebird servers are required for the extension to be loaded - not to read the data but merely to try connecting to servers
I have install IBSURGERON FIRST AID : and get that values : 09:05:51 INFO: ODS Major = 11 (32779) 09:05:51 INFO: ODS Minor = 2 if i have that values , so i must install firebird 2.5, and it always was installed but i can't connect to my base
2.5.8 ? There was big problem with indexes around 2.5.1 AFAIR. Is Firebird Default Server running, open Windows Services and check? Then, can you open your database with some free IDE like FlameRobin or IBExpert Personal ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.