Subject Re: [firebird-php] firebird path
Author Milan Babuskov
Lester Caine wrote:
> The current solution is to add an edit box for the path in the
> installer, and get the user to populate it.

Sounds reasonable.

> The real solution would be an environment variable as part of the
> Firebird install.

I wrote in other e-mail, but let me explain. I don't know about Windows, but
on Linux, env. variables are made on per-user basis. They are setup in system
startup scripts, which are various depending on which Linux distribution you
use. Only a bare minimum is setup for system deamons like Firebird, Apache,
etc. Often, each deamon has its own startup script that sets the needed env.
variables, which are in-turn only valid to that process. If Firebird startup
script sets some env.variable it is "local" to it, i.e. Apache&PHP know
nothing about it.

Sidenote: users have they own env. variables, set by the shell and/or X
windows system they run. But, deamons know nothing about it.

Ok, now what would be a solution to this. Well, you could:

1. make the Firebird installer modify system startup scripts
2. make the Firebird installer modify Apache startup scripts

Neither of these seem appropriate. On Windows it is easy. You have Registry,
an uniform informational facility. There are some ideas to make something
similar on Linux (I could find URL if someone is interested), but no major
distribution has accepted that yet.

Viable alternatives seem:

3. search in common paths (as I wrote in other email)

4. I saved the best for last:

Do a simple system call to get full path to running Firebird server:
ps -eo "%a" | grep fbserver

In the string you get, just replace fbserver with isql and you're done. The
only problem with this approach is that Firebird has to be running. I don't
know if it is an issue for your setup?

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org