|
Posted by Jochem Maas on 11/11/29 11:15
James wrote:
> I've attempted to access a firebird database living on an osx/apache/php
> machine.
>
> When I'm running the following script,
> <?php
>
> ini_set("magic_quotes_sybase", "On");
>
> $host =
> 'localhost:/Library/Frameworks/Firebird.framework/Resources/examples/employee.fdb';
for portability and ease of use I recommend using aliases with firebird. firebird
has a file named aliases.conf which should contain the following line:
exampledb = /Library/Frameworks/Firebird.framework/Resources/examples/employee.fdb
once you have restarted firebird you can write the host var like so:
$host = 'localhost:exampledb';
>
> $username = "sysdba";
> $password = "masterkey";
>
>
>
> $dbh = ibase_connect($host, $username, $password);
>
> if (!($dbh=ibase_connect($host, 'sysdba', 'yourpass', 'ISO8859_1',
> 0, 1)))
> die('Could not connect: ' . ibase_errmsg());
>
> $stmt = 'SELECT * FROM employee';
> $sth = ibase_query($dbh, $stmt);
> while ($row = ibase_fetch_object($sth)) {
> echo $row->full_name, "\n";
> }
> ibase_free_result($sth);
> ibase_close($dbh);
> ?>
>
> I get the following error:
> "Call to undefined function ibase_connect()"
>
>
> How do I enable those functions? I've looked at the php documentation
> (http://uk2.php.net/manual/en/ref.ibase.php )
>
> "To enable InterBase support configure PHP --with-interbase[=DIR], where
> DIR is the InterBase base install directory, which defaults to
> /usr/interbase."
> I've tried to add:
> --with-interbase=/Library/Frameworks/Firebird.framework/Resources
> to my php.ini and it didn't work.
>
oh dear you are lost (no offence, I know the feeling!).
configuring in this instance means configuring the 'build' before you
compile php.... this may not even be necessary in your
case (if you have the interbase extension already built)
at any rate there should not be anything like '--with-interbase=' in
your php.ini!
instead you will need a line that goes something like:
extension=php_interbase.dll (windows)
only in your case the extension will be called something like
php_interbase.so
php_ibase.so
php_ibase.dylib (I guess, could be wrong)
> Am I pointing to the wrong directory? What other configuration/setup do
> I have to do to enable php's interbase functions?
you need to have a binary of the php interbase extension suitable for your
php build AND you need to load the extension
>
> Thanks.
>
Navigation:
[Reply to this message]
|