View Single Post
  #2 (permalink)  
Old 27th March 2009, 20:47
u.masotti u.masotti is offline
D4PHP Guru
 
Join Date: Nov 2007
Posts: 228
u.masotti is on a distinguished road
Default Howto connect Firebird db: the pratical section.

When Delphi for PHP installs, it installs IDE, PHP, Apache server, PHP debugger, and a lot of other small pieces of software.
Among them there are the so called "database client libraries", that aren't part of PHP, but are part of database's servers software package. So you'll be able to find the client libraries from Oracle, MsSQL, MySql, Sybase, Interbase and so on.
And Firebird?

Actually Firebird's client lib is called fbclient.dll, and you cannot find it in Delphi for PHP installation dir, as it is out of the box. Ok, you can say, instead I found GDS32.DLL: I can copy FBCLIENT.DLL in the same directory and I'd solve problem.
No, this is not a solution: no piece in Windows PHP package searches for fbclient.dll.
PHP interface library, as stated before, searches for GDS32.DLL only, and that is Interbase client lib.

Anyway, you don't ever need Firebird's GDS32.DLL in Delphi for PHP subdirectories: you need to install it properly only in system directories because this is a piece of software maintained from Firebird installation system, not from D4PHP.

So there are two simple step to get Firebird working:
  1. Remove Interbase's GDS32.DLL. To do so, you need only to rename it, wherever is.
  2. Install Firebird's GDS32.DLL, and you need to force installation only in system directory.
I suppose you are on Windows XP, using Delphi for PHP 2.0 and Firebird 2.1. If this is not the case, adjust operation and/or directory names accordingly. Also convert names of programs' folder in your language.
Step 1.
  1. Exit from the D4PHP IDE, if you have it opened.
  2. Explore to Delphi for PHP installation dir, i.e. something like C:\Program Files\CodeGear\Delphi for PHP\2.0
  3. Click on the Search button
  4. Search for all file named "GDS32.DLL" contained there and in subdirectories.You'll find four of them, i.e. four identical copies of the same file!
  5. Rename all of them to something evident, like GDS32_IB.DLL
  6. Close explorer window

Step 2.
  1. Open a terminal window.
  2. Change to Firebird installation bin directory, i.e. something like C:\Program Files\Firebird\Firebird2_1\bin
  3. Type the command
    Code:
    instclient -f i g
    (note the spaces between -f and i, and between i and g)
  4. To verify correct driver installation, type command
    Code:
    instclient q g
  5. Close terminal window typing command
    Code:
    exit

Now you can connect Firebird through ibase_* native set of functions, or trough native components (Database and Query) setting database driver as "firebird".

Hope that this guide will help people developing in Delphi for PHP that is using Firebird as database server.
__________________
Ciao.
Mimmo.
Reply With Quote
Sponsored Links