Subject | RE: [firebird-php] PHP with Embedded Firebird on Hosting Server |
---|---|
Author | Nigel Weeks |
Post date | 2005-12-07T21:54:27Z |
> I'm looking to use an embedded firebird database on a hosted server. ISo, what you're asking is, Can I sneak enough Firebird code into my account
> have no access to actually recompile php, nor can I actually install
> firebird server (obviously). I was just curious, is it possible to
> interact with the embedded database without any extra options? How
> could I check?
space on a non-firebird equipped server, to enable me to run a website that
uses a Firebird DB?
Is this correct? If so, it's a tough one. Real tough.
You might be able to ship the php_interbase.so, and do a
"dl('interbase.so')" to actually load the PHP module, but then the module
will need to be able to find the Firebird dll/so for embedded server.
It usually looks in the current directory, so that theoretically should
work - however...by using the 'embedded server' dll/so, you limit yourself
to one connection only - that's one user to your web page - not real flash.
There's two more ways of accomplishing this.
Include a complete gds.so/firebird.so from a complete firebird
installation, and connect to a firebird database hosted somewhere else. This
opens a can of worms - you'll have plainly visible DB traffic to and from
this host and your DB host. Also, it means your DB has to be listening on a
public interface - not a good idea.
The final way is MUCH harder, but might just work.
There are projects around the place that build web-proxy servers in PHP.
Take one of these, strip it to pieces, and re-build the internals to form a
connection-pooling proxy server:
Listen on port 3050
for each request, asynchronously assign them to a queue(array of requests)
(non blocking)
Check each request. If it's been done in the last 5 minutes, return
results from a saved memory location(cache array)
If not in cache array, pass each request to the embedded dll(which talks
to your .fdb file), and pass results back to the requesting session(caching
into an array as you go).
Terminate the connection, returning whatever values were requested.
Repeat.
This approach will require your host to have a CGI/CLI version of PHP
available also - very rare. It's so difficult, it's not worth considering,
but it IS possible...
Nige.