Delphi For PHP Forums    


Go Back   Delphi-PHP Forums > Delphi4PHP NNTP Newsgroups > embarcadero.public.delphiphp.database
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

embarcadero.public.delphiphp.database This group is for all discussion about databases and using them with Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12th February 2010, 20:49
Marius Labuschagne
Guest
 
Posts: n/a
Default Using Firebird

Hi,

I am new to Delphi 4 PHP and would like to find out how I can make use
of a Firebird 2.1.3 database in my project.

Is there anyone that has already done this that can give me some guidance?

Regards
Marius
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 13th February 2010, 00:20
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,480
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

How to connect to a Firebird db server from Delphi for PHP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 13th February 2010, 07:30
just Joined!
 
Join Date: Feb 2010
Location: East London - South Africa
Posts: 2
MariusJL is on a distinguished road
Default Using Firebird

Hi,

I have followed the instructions in the referred post, but still get the following when trying to run the php application with a database component setup to connect to Firebird.

Warning: ibase_connect() [function.ibase-connect]: unavailable database in C:\Program Files\CodeGear\Delphi for PHP\2.0\vcl\adodb\drivers\adodb-ibase.inc.php on line 74

Application raised an exception class EDatabaseError with message 'Cannot connect to database server'

My database component is setup as follows:
Connected: true
DatabaseName: localhost:C:\_Tests\DelphiPHP\Blog\Database\BLOGS.FDB
DriverName: Firebird
Host: 127.0.0.1
Name: Database1
Username: sysdba
Password: masterkey

Is there anything else I can check to get this working?

Regards
Marius
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 13th February 2010, 19:08
D4PHP Guru
 
Join Date: Nov 2007
Posts: 237
u.masotti is on a distinguished road
Default

Quote:
Originally Posted by MariusJL View Post
Connected: true
DatabaseName: localhost:C:\_Tests\DelphiPHP\Blog\Database\BLOGS.FDB
DriverName: Firebird
Host: 127.0.0.1
Name: Database1
Username: sysdba
Password: masterkey
From your connection string I can argue you are trying to connect to FB installed in the development machine. In C:\Program Files\Firebird\Firebird_2_1\bin you can check if isql connects to your database.

Firebird version? Latest Firebird 2.5 RC has problems in some OS configurations with PHP and Apache. Must check if in windows too, but it's good to know also if Classic or Superserver.

Firebird 2.1.3 must be ok, try to check in firebird.conf if directories where to find database can be everywhere. If DatabaseAccess parameter is NONE, you can access database only through aliases defined in aliases.conf (see related doc in firebird.conf)

You can try also direct connection, i.e. removing "localhost:" from DatabaseName to check if there are any TCP problem.

Connection with other maintenaince application, i.e. IBExpert or FlameRobin, is ok?

Firebird is started as application or service (the default)?
If it's started as service, try to check if it's runnig in Task Manager.

Edited:
Which version are you using of D4PHP? If 2.0, don't use Interbase components but standard general database components.

Last edited by u.masotti; 13th February 2010 at 20:02. Reason: D4PHP version and VCL components
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 14th February 2010, 04:11
just Joined!
 
Join Date: Feb 2010
Location: East London - South Africa
Posts: 2
MariusJL is on a distinguished road
Default

Hi,

Thank you for your response.

Yes you're right this is on my dev machine, first want to get it working over here before I start pointing to live databases. ISQL can connect to the database.

Running Firebird 2.1.3 as Superserver and as a service.

firebird.conf is default, no changes made, the value for database paths/directories is commented out like this:
#DatabaseAccess = Full

Connections from IBExpert and DatabaseWorkbench is working 100%.

I am using D4PHP 2.0

I think maybe it is something silly I am doing or expecting. I can access the database from DataExplorer. As soon as I right click on the database component though and select create dictionary I get an error from ibase_connect that says Error trying to open file and it points to where my database resides. Don't know if this will make a difference but my database does not have the standard extension of FDB but rather it has a MXD extension.

Also I have PHP version 5.2.12 installed on my box.

The scripts execute now if I run it from with D4PHP (I used the Data Explorer to drag and drop and then set the DriverName to firebird), but as soon as I deploy it I cannot access the deployed script. It is deployed on IIS 7, and browsing to the script in Firefox just gives a blank page, in the IDE I actually get the correct output.

http://localhost/testsite/unit1.php

Regards
Marius

PS. Is there not a demo application specifically developed for Firebird with D4PHP 2.0 somewhere that I can download and learn from?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 14th February 2010, 12:23
D4PHP Guru
 
Join Date: Nov 2007
Posts: 237
u.masotti is on a distinguished road
Default

Hi Marius,

Quote:
Originally Posted by MariusJL View Post
ISQL can connect to the database.
Good: firebird server and firebird client are ok then.
Quote:
Running Firebird 2.1.3 as Superserver and as a service.
firebird.conf is default, no changes made, the value for database paths/directories is commented out like this:
#DatabaseAccess = Full
Connections from IBExpert and DatabaseWorkbench is working 100%.
This leaves problems only in Apache and PHP sides.
Quote:
I am using D4PHP 2.0
I think maybe it is something silly I am doing or expecting. I can access the database from DataExplorer. As soon as I right click on the database component though and select create dictionary I get an error from ibase_connect that says Error trying to open file and it points to where my database resides. Don't know if this will make a difference but my database does not have the standard extension of FDB but rather it has a MXD extension.
Please, correct me if I'm wrong.
In development system, AFAIU, you can open daabase and read the data in the tables, but you cannot generate dictionary tables?
If this is the case, use an alias for your database if you can.
I had problems in D4PHP 1.0 with non standard extension using dictionary functions: some of them were broken expecting GDB as supported extension only. Don't know if ever resolved in 2.0, but for security purposes, as suggested also in FB releases notes, it's better have DatabaseAcces=None and aliases.conf as the only source for databases' pathnames.
Quote:
Also I have PHP version 5.2.12 installed on my box.
You mean deploy machine, not development one, right?
Don't upgrade D4PHP/php dir, as VCL and IDE AFAIK doesn't support recent PHP releases.
Quote:
The scripts execute now if I run it from with D4PHP (I used the Data Explorer to drag and drop and then set the DriverName to firebird), but as soon as I deploy it I cannot access the deployed script. It is deployed on IIS 7, and browsing to the script in Firefox just gives a blank page, in the IDE I actually get the correct output.
In deploy box have you checked firebird installation?
php-interbase.dll matches IIS version (32/64 bit, MSVC9/MSVC6, multithreaded/single threaded)
Ini scripts are correctly configured?
Hint, start your php source with this two instructions at the very beginning:
PHP Code:
<?php
ini_set
("display_errors",1);
error_reporting(E_ALL);
Obviously this is an internal address, isn't it?
Quote:
Is there not a demo application specifically developed for Firebird with D4PHP 2.0 somewhere that I can download and learn from?
With standard VCL objects, I must check my backups for test app.
But I never used dictionary, so cannot say much about that.

Last edited by u.masotti; 14th February 2010 at 12:38. Reason: Adding PHP runtime error checks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 05:52.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use