Installing Firebird: Difference between revisions
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by Letsgolee) |
||
Line 1: | Line 1: | ||
== Introductions == | == Introductions == | ||
The following method is a little changed from that which I explained in http://forum.uniformserver.com. You can see the previouse one clicking [http://forum.uniformserver.com/index.php?showtopic=1433 here]. | The following method is a little changed from that which I explained in http://forum.uniformserver.com. You can see the previouse one clicking [http://forum.uniformserver.com/index.php?showtopic=1433 here]. | ||
Thanks to the policy of Firebird that it allows the server run as an application we can install firebird into Uniform Server. the key is adding | Thanks to the policy of Firebird that it allows the server run as an application we can install firebird into Uniform Server. the key is adding "-a" after fbserver.exe command: '''fbserver.exe -a'''. | ||
Firebird is open source and supports many options and syntaxes more than mysql. Still there are not many who use firebird as an web-based server. because of that I also had a hard time to use it. To many of us Mysql is a great option to use but it's not open source. I spent my time to install firebird to Uniform server and I just want to be a helper to them who want to use firebird as a portable database server. | Firebird is open source and supports many options and syntaxes more than mysql. Still there are not many who use firebird as an web-based server. because of that I also had a hard time to use it. To many of us Mysql is a great option to use but it's not open source. I spent my time to install firebird to Uniform server and I just want to be a helper to them who want to use firebird as a portable database server. | ||
Line 10: | Line 9: | ||
== Install Firebird Server == | == Install Firebird Server == | ||
Visit http://www.firebirdsql.org and download the latest firebird no-install version and uncompress the zip to the uniform server\udrive\usr\local and change the newly created folder name to firebird. Here is the [http://sourceforge.net/project/downloading.php?groupname=firebird& | Visit http://www.firebirdsql.org and download the latest firebird no-install version and uncompress the zip to the uniform server\udrive\usr\local and change the newly created folder name to firebird. Here is the [http://sourceforge.net/project/downloading.php?groupname=firebird&filename=Firebird-2.1.0.17798-0_Win32.zip&use_mirror=nchc&testing=1 link] for firebird v.2.1.0.17798. | ||
Make a folder where you want to save firebird database files like: \udrive\var\firebird | Make a folder where you want to save firebird database files like: \udrive\var\firebird | ||
== Edit start_server.bat == | == Edit start_server.bat == | ||
Open start_server.bat and find a line like: | Open start_server.bat and find a line like:<pre>start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf</pre> | ||
Under that line write down and save: | Under that line write down and save: | ||
<pre>start \usr\local\firebird\bin\fbserver.exe -a</pre> | |||
== Edit php.ini == | == Edit php.ini == | ||
Line 25: | Line 24: | ||
Open php.ini and find extension option and uncomment extension=php_interbase.dll. If you want to use pdo then uncomment extension=php_pdo_firebird.dll also. | Open php.ini and find extension option and uncomment extension=php_interbase.dll. If you want to use pdo then uncomment extension=php_pdo_firebird.dll also. | ||
Add the following to php.ini: | Add the following to php.ini:<pre><nowiki>[InterBase] | ||
ibase.allow_persistent = | ibase.allow_persistent = | ||
ibase.max_persistent = | ibase.max_persistent = | ||
Line 35: | Line 34: | ||
ibase.timestampformat = | ibase.timestampformat = | ||
ibase.dateformat = | ibase.dateformat = | ||
ibase.timeformat = | ibase.timeformat =</nowiki></pre>The value is not given. set your own value if you want. Blank means default value will be used. | ||
"Strings in Firebird are delimited by a pair of single quote (apostrophe) symbols", so if you want convenience change the value of "magic_quotes_sybase" to "On" | |||
== Edit Close.bat == | == Edit Close.bat == | ||
Open \udrive\home\admin\program\Close.bat and find the line: | Open \udrive\home\admin\program\Close.bat and find the line: | ||
<pre>:nomysql</pre> | |||
Add under: | Add under: | ||
<pre>%Disk%:\home\admin\program\pskill.exe fbserver.exe | |||
IF ERRORLEVEL 1 goto nofirebird | IF ERRORLEVEL 1 goto nofirebird | ||
%Disk%:\home\admin\program\pskill.exe fbserver.exe c | %Disk%:\home\admin\program\pskill.exe fbserver.exe c | ||
:nofirebird | :nofirebird</pre> | ||
Firebird tray icon will be shown so we can shutdown the server using tray icon but we want the database server to be shutdowned when we finish the Uniform server. So we use pskill to kill the process by force. | Firebird tray icon will be shown so we can shutdown the server using tray icon but we want the database server to be shutdowned when we finish the Uniform server. So we use pskill to kill the process by force. | ||
Line 54: | Line 53: | ||
Open ibWebAdmin\inc\configuration.inc.php and change some values like: | Open ibWebAdmin\inc\configuration.inc.php and change some values like: | ||
<pre>define('BINPATH', '/usr/local/firebird/bin/'); | |||
define('SECURITY_DB', '/usr/local/firebird/security2.fdb'); | define('SECURITY_DB', '/usr/local/firebird/security2.fdb'); | ||
define('TMPPATH', '/tmp/'); | define('TMPPATH', '/tmp/');</pre> | ||
<pre>define('DEFAULT_PATH', '/var/firebird/');</pre> | |||
We already created \var\firebird folder for saving database! | We already created \var\firebird folder for saving database! | ||
<pre>define('DEFAULT_HOST', 'localhost');</pre> | |||
<pre>define('DEFAULT_CACHE', 8192); </pre> | |||
for better caching. You can change that. | for better caching. You can change that. | ||
<pre>define('DEFAULT_SERVER', 'FB_2.0'); | |||
$ALLOWED_DIRS = array('/var/firebird/', | $ALLOWED_DIRS = array('/var/firebird/', | ||
'/tmp/'); | '/tmp/');</pre> | ||
<pre>define('BACKUP_DIR', '/var/firebird/backup/'); </pre> | |||
You need to create \var\firebird\backup for backup folder. | You need to create \var\firebird\backup for backup folder. | ||
== Edit Firebird configuration == | == Edit Firebird configuration == | ||
Open \udrive\usr\local\firebird\firebird.conf and change some values like: | Open \udrive\usr\local\firebird\firebird.conf and change some values like: | ||
<pre>RootDirectory = \usr\local\firebird</pre> | |||
<pre>DatabaseAccess = Restrict W:\usr\local\firebird;W:\var\firebird;W:\var\firebird\backup</pre> | |||
Be careful when you define the DatabaseAccess, it should have the drive letter | Be careful when you define the DatabaseAccess, it should have the drive letter "W:", otherwise the firebird gives you error. | ||
<pre>TempDirectories = /tmp | |||
DefaultDbCachePages = 8192 | DefaultDbCachePages = 8192</pre> | ||
== Edit Uniform Admin Panel Files == | == Edit Uniform Admin Panel Files == | ||
Open \udrive\home\admin\www\includes\tool.inc and find line: | Open \udrive\home\admin\www\includes\tool.inc and find line: | ||
<pre><a target="_phpmyadmin" onclick="h(this);" href="<?=$apanel?>/phpMyAdmin/"><?=$US['nav-pma']?></a></pre> | |||
Add next: | Add next: | ||
<pre><a target="_ibwebadmin" onclick="h(this);" href="<?=$apanel?>/ibWebAdmin/"><?=$US['nav-ibwa']?></a></pre> | |||
Open \udrive\home\admin\www\includes\server.inc and find line: | Open \udrive\home\admin\www\includes\server.inc and find line: | ||
<pre><a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/smysql.cgi"><?=$US['nav-smysql']?></a></pre> | |||
Add next: | Add next: | ||
<pre><a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/rfirebird.cgi"><?=$US['nav-rfirebird']?></a> | |||
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/sfirebird.cgi"><?=$US['nav-sfirebird']?></a></pre> | |||
Open \udrive\home\admin\www\cgi-bin\includes\lang\en\sserver.cgi and find: | Open \udrive\home\admin\www\cgi-bin\includes\lang\en\sserver.cgi and find: | ||
<pre> system "/home/admin/program/uniserv.exe \"\\usr\\local\\mysql\\bin\\mysqladmin.exe --user=root --password=$password shutdown\""; | |||
} | }</pre> | ||
Add next: | Add next: | ||
<pre>$res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; | |||
if ($res == 0){ | if ($res == 0){ | ||
system | system "/home/admin/program/pskill.exe fbserver.exe c"; | ||
} | }</pre> | ||
Open \udrive\home\admin\www\includes\lang\en.php add in the code: | Open \udrive\home\admin\www\includes\lang\en.php add in the code: | ||
<pre> 'nav-rfirebird' => 'Run Firebird', | |||
'nav-sfirebird' = | 'nav-sfirebird' => 'Stop Firebird', | ||
'nav-ibwa' = | 'nav-ibwa' => 'ibWebAdmin',</pre> | ||
== Create Files == | == Create Files == | ||
Create rfirebird.cgi file in the \udrive\home\admin\www\cgi-bin\includes\lang\en: | Create rfirebird.cgi file in the \udrive\home\admin\www\cgi-bin\includes\lang\en: | ||
<pre>#!/usr/bin/perl | |||
require header; | require header; | ||
require secure; | require secure; | ||
print | print " | ||
<div id=\"main\"> | |||
<h2>» Start Firebird</h2> | |||
<h3>Starting Firebird</h3> | |||
<p>"; | |||
& | &check_Firebird; | ||
if ($run) { | if ($run) { | ||
if ($ENV{'QUERY_STRING'}eq | if ($ENV{'QUERY_STRING'}eq"F"){ | ||
& | &start_Firebird; | ||
print | print "Firebird server was forced to start."; | ||
print | print "<br />"; | ||
} | } | ||
else { | else { | ||
print | print <<ENDDD; | ||
Firebird server already running. | Firebird server already running. | ||
<br /> | |||
But if you think that it is mistake click on this | But if you think that it is mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a> | ||
<br /> | |||
</p> | |||
</div> | |||
ENDDD | ENDDD | ||
} | } | ||
Line 137: | Line 136: | ||
else { | else { | ||
print | print <<ENDDD; | ||
Firebird server started. | Firebird server started. | ||
</p> | |||
</div> | |||
ENDDD | ENDDD | ||
require footer; | require footer; | ||
& | &start_Firebird; | ||
} | } | ||
Line 151: | Line 150: | ||
sub check_Firebird(){ | sub check_Firebird(){ | ||
$res = system | $res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; | ||
if ($res == 0){$run=1} | if ($res == 0){$run=1} | ||
else {$run=0} | else {$run=0} | ||
Line 157: | Line 156: | ||
sub start_Firebird(){ | sub start_Firebird(){ | ||
exec | exec "/usr/local/firebird/bin/fbserver.exe -a"; | ||
} | }</pre> | ||
Create sfirebird.cgi file in \udrive\home\admin\www\cgi-bin\includes\lang\en: | Create sfirebird.cgi file in \udrive\home\admin\www\cgi-bin\includes\lang\en: | ||
<pre>#!/usr/bin/perl | |||
require header; | require header; | ||
require secure; | require secure; | ||
print | print " | ||
<div id=\"main\"> | |||
<h2>» Stop Firebird</h2> | |||
<h3>Stopping Firebird</h3> | |||
<p>"; | |||
& | &check_Firebird; | ||
if ($run) { | if ($run) { | ||
& | &stop_Firebird; | ||
print | print "Firebird server stopped.<br>"; | ||
} | } | ||
else { | else { | ||
if ($ENV{'QUERY_STRING'}eq | if ($ENV{'QUERY_STRING'}eq"F"){ | ||
& | &stop_Firebird; | ||
print | print "Firebird server was forced to stop."; | ||
print | print "<br>"; | ||
} | } | ||
else { | else { | ||
print | print <<ENDDD; | ||
Firebird server was not running. | Firebird server was not running. | ||
<br /> | |||
But if you think that it is a mistake click on this | But if you think that it is a mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a> | ||
<br /> | |||
ENDDD | ENDDD | ||
} | } | ||
} | } | ||
print | print <<ENDDD; | ||
</p> | |||
</div> | |||
ENDDD | ENDDD | ||
Line 204: | Line 203: | ||
sub check_Firebird(){ | sub check_Firebird(){ | ||
$res = system | $res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; | ||
if ($res == 0){$run=1} | if ($res == 0){$run=1} | ||
else {$run=0} | else {$run=0} | ||
} | } | ||
sub stop_Firebird(){ | sub stop_Firebird(){ | ||
system | system "/home/admin/program/pskill.exe fbserver.exe c"; | ||
} | }</pre> | ||
== Copy DLL == | == Copy DLL == | ||
Line 223: | Line 222: | ||
If you encounter 'too many open links(0)' error or 'Undefined service gds_db/tcp' error then | If you encounter 'too many open links(0)' error or 'Undefined service gds_db/tcp' error then | ||
add the following line to %SystemRoot%\system32\drivers\etc\services: | add the following line to %SystemRoot%\system32\drivers\etc\services: | ||
<pre>gds_db 3050/tcp #InterBase Server</pre> | |||
You can create install_gds_db.php file in \udrive\home\admin\www: | You can create install_gds_db.php file in \udrive\home\admin\www: | ||
<pre><?php | |||
// flag for gds_db port | // flag for gds_db port | ||
$f_gds_db = false; | $f_gds_db = false; | ||
$systemroot = getenv( | $systemroot = getenv("SystemRoot"); | ||
$service_file = $systemroot.DIRECTORY_SEPARATOR.'system32'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR.'etc'.DIRECTORY_SEPARATOR.'services'; | $service_file = $systemroot.DIRECTORY_SEPARATOR.'system32'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR.'etc'.DIRECTORY_SEPARATOR.'services'; | ||
Line 245: | Line 244: | ||
if (!$f_gds_db) { | if (!$f_gds_db) { | ||
if ($fp = fopen($service_file, 'a')) { | if ($fp = fopen($service_file, 'a')) { | ||
fwrite($fp, | fwrite($fp, "\r\ngds_db 3050/tcp #InterBase Server"); | ||
fclose($fp); | fclose($fp); | ||
echo | echo "<script>alert('gds_db port is sucessfully installed.\\nPlease restart the server!');</script>\n"; | ||
} | } | ||
else { | else { | ||
echo | echo "<script>alert('failed to install gds_db port!\\nIf you want to use Firebird database you have to open gds_db port manually.\\nAdd the following line to services file:\\ngds_db\\t\\t3050/tcp\\t\\t#InterBase Server');</script>\n"; | ||
} | } | ||
} | } | ||
? | ?></pre> | ||
Put the following code somewhere in the \udrive\home\admin\www\index.php, then when you start the server if the gds_db port is not installed it will install automatically. This is good for portable server. Anywhere you go just start the server then everything is ok: | Put the following code somewhere in the \udrive\home\admin\www\index.php, then when you start the server if the gds_db port is not installed it will install automatically. This is good for portable server. Anywhere you go just start the server then everything is ok: | ||
<pre><? | |||
include | include "install_gds_db.php"; | ||
? | ?></pre> | ||
Revision as of 08:37, 24 November 2010
Introductions
The following method is a little changed from that which I explained in http://forum.uniformserver.com. You can see the previouse one clicking here.
Thanks to the policy of Firebird that it allows the server run as an application we can install firebird into Uniform Server. the key is adding "-a" after fbserver.exe command: fbserver.exe -a.
Firebird is open source and supports many options and syntaxes more than mysql. Still there are not many who use firebird as an web-based server. because of that I also had a hard time to use it. To many of us Mysql is a great option to use but it's not open source. I spent my time to install firebird to Uniform server and I just want to be a helper to them who want to use firebird as a portable database server.
The following shows how to install Firebird to your portable Uniform server.
Install Firebird Server
Visit http://www.firebirdsql.org and download the latest firebird no-install version and uncompress the zip to the uniform server\udrive\usr\local and change the newly created folder name to firebird. Here is the link for firebird v.2.1.0.17798.
Make a folder where you want to save firebird database files like: \udrive\var\firebird
Edit start_server.bat
Open start_server.bat and find a line like:
start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf
Under that line write down and save:
start \usr\local\firebird\bin\fbserver.exe -a
Edit php.ini
Check that you have php_interbase.dll in your php extension folder. If you don't have you have to get it from http://www.php.net. You will need php_pdo_firebird.dll also if you want to use PDO.
Open php.ini and find extension option and uncomment extension=php_interbase.dll. If you want to use pdo then uncomment extension=php_pdo_firebird.dll also.
Add the following to php.ini:
[InterBase] ibase.allow_persistent = ibase.max_persistent = ibase.max_links = ibase.default_db = ibase.default_user = ibase.default_password = ibase.default_charset = ibase.timestampformat = ibase.dateformat = ibase.timeformat =
The value is not given. set your own value if you want. Blank means default value will be used.
"Strings in Firebird are delimited by a pair of single quote (apostrophe) symbols", so if you want convenience change the value of "magic_quotes_sybase" to "On"
Edit Close.bat
Open \udrive\home\admin\program\Close.bat and find the line:
:nomysql
Add under:
%Disk%:\home\admin\program\pskill.exe fbserver.exe IF ERRORLEVEL 1 goto nofirebird %Disk%:\home\admin\program\pskill.exe fbserver.exe c :nofirebird
Firebird tray icon will be shown so we can shutdown the server using tray icon but we want the database server to be shutdowned when we finish the Uniform server. So we use pskill to kill the process by force.
Install Web Admin tool
Download the ibWebAdmin from here and unzip to \udrive\home\admin\www
Open ibWebAdmin\inc\configuration.inc.php and change some values like:
define('BINPATH', '/usr/local/firebird/bin/'); define('SECURITY_DB', '/usr/local/firebird/security2.fdb'); define('TMPPATH', '/tmp/');
define('DEFAULT_PATH', '/var/firebird/');
We already created \var\firebird folder for saving database!
define('DEFAULT_HOST', 'localhost');
define('DEFAULT_CACHE', 8192);
for better caching. You can change that.
define('DEFAULT_SERVER', 'FB_2.0'); $ALLOWED_DIRS = array('/var/firebird/', '/tmp/');
define('BACKUP_DIR', '/var/firebird/backup/');
You need to create \var\firebird\backup for backup folder.
Edit Firebird configuration
Open \udrive\usr\local\firebird\firebird.conf and change some values like:
RootDirectory = \usr\local\firebird
DatabaseAccess = Restrict W:\usr\local\firebird;W:\var\firebird;W:\var\firebird\backup
Be careful when you define the DatabaseAccess, it should have the drive letter "W:", otherwise the firebird gives you error.
TempDirectories = /tmp DefaultDbCachePages = 8192
Edit Uniform Admin Panel Files
Open \udrive\home\admin\www\includes\tool.inc and find line:
<a target="_phpmyadmin" onclick="h(this);" href="<?=$apanel?>/phpMyAdmin/"><?=$US['nav-pma']?></a>
Add next:
<a target="_ibwebadmin" onclick="h(this);" href="<?=$apanel?>/ibWebAdmin/"><?=$US['nav-ibwa']?></a>
Open \udrive\home\admin\www\includes\server.inc and find line:
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/smysql.cgi"><?=$US['nav-smysql']?></a>
Add next:
<a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/rfirebird.cgi"><?=$US['nav-rfirebird']?></a> <a target="content" onclick="h(this);" href="<?=$apanel?>/cgi-bin/includes/lang/<?=file_get_contents("includes/.lang");?>/sfirebird.cgi"><?=$US['nav-sfirebird']?></a>
Open \udrive\home\admin\www\cgi-bin\includes\lang\en\sserver.cgi and find:
system "/home/admin/program/uniserv.exe \"\\usr\\local\\mysql\\bin\\mysqladmin.exe --user=root --password=$password shutdown\""; }
Add next:
$res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; if ($res == 0){ system "/home/admin/program/pskill.exe fbserver.exe c"; }
Open \udrive\home\admin\www\includes\lang\en.php add in the code:
'nav-rfirebird' => 'Run Firebird', 'nav-sfirebird' => 'Stop Firebird', 'nav-ibwa' => 'ibWebAdmin',
Create Files
Create rfirebird.cgi file in the \udrive\home\admin\www\cgi-bin\includes\lang\en:
#!/usr/bin/perl require header; require secure; print " <div id=\"main\"> <h2>» Start Firebird</h2> <h3>Starting Firebird</h3> <p>"; &check_Firebird; if ($run) { if ($ENV{'QUERY_STRING'}eq"F"){ &start_Firebird; print "Firebird server was forced to start."; print "<br />"; } else { print <<ENDDD; Firebird server already running. <br /> But if you think that it is mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a> <br /> </p> </div> ENDDD } } else { print <<ENDDD; Firebird server started. </p> </div> ENDDD require footer; &start_Firebird; } require footer; exit; sub check_Firebird(){ $res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; if ($res == 0){$run=1} else {$run=0} } sub start_Firebird(){ exec "/usr/local/firebird/bin/fbserver.exe -a"; }
Create sfirebird.cgi file in \udrive\home\admin\www\cgi-bin\includes\lang\en:
#!/usr/bin/perl require header; require secure; print " <div id=\"main\"> <h2>» Stop Firebird</h2> <h3>Stopping Firebird</h3> <p>"; &check_Firebird; if ($run) { &stop_Firebird; print "Firebird server stopped.<br>"; } else { if ($ENV{'QUERY_STRING'}eq"F"){ &stop_Firebird; print "Firebird server was forced to stop."; print "<br>"; } else { print <<ENDDD; Firebird server was not running. <br /> But if you think that it is a mistake click on this <a href="$ENV{SCRIPT_NAME}?F">link</a> <br /> ENDDD } } print <<ENDDD; </p> </div> ENDDD require footer; exit; sub check_Firebird(){ $res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe"; if ($res == 0){$run=1} else {$run=0} } sub stop_Firebird(){ system "/home/admin/program/pskill.exe fbserver.exe c"; }
Copy DLL
Copy fbclient.dll from \udrive\usr\local\firebird\bin to \udrive\usr\local\php. and for compatibility copy another and change its name to gds32.dll. If you have already then replace it. If the version of dll and the server are different it will not work!
If you encounter errors like “Application failed to start gds32.dll not found” or similiar there are solutions for these. try some of following:
Copy fbclient.dll also to \udrive\usr\local\apache\bin and copy another and change its name to gds32.dll. If you still have problem to connect to the server then you probably have gds32.dll or fbclient.dll in your %WINDIR%system32 folder and the dll file is of a old version. replace it or if you don't have any applications that use the dll file then remove it.
GDS_DB Problem
If you encounter 'too many open links(0)' error or 'Undefined service gds_db/tcp' error then add the following line to %SystemRoot%\system32\drivers\etc\services:
gds_db 3050/tcp #InterBase Server
You can create install_gds_db.php file in \udrive\home\admin\www:
<?php // flag for gds_db port $f_gds_db = false; $systemroot = getenv("SystemRoot"); $service_file = $systemroot.DIRECTORY_SEPARATOR.'system32'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR.'etc'.DIRECTORY_SEPARATOR.'services'; $lines = file($service_file); foreach ($lines as $line) { if (strpos($line, 'gds_db') !== false) { $f_gds_db = true; break; } } if (!$f_gds_db) { if ($fp = fopen($service_file, 'a')) { fwrite($fp, "\r\ngds_db 3050/tcp #InterBase Server"); fclose($fp); echo "<script>alert('gds_db port is sucessfully installed.\\nPlease restart the server!');</script>\n"; } else { echo "<script>alert('failed to install gds_db port!\\nIf you want to use Firebird database you have to open gds_db port manually.\\nAdd the following line to services file:\\ngds_db\\t\\t3050/tcp\\t\\t#InterBase Server');</script>\n"; } } ?>
Put the following code somewhere in the \udrive\home\admin\www\index.php, then when you start the server if the gds_db port is not installed it will install automatically. This is good for portable server. Anywhere you go just start the server then everything is ok:
<? include "install_gds_db.php"; ?>
(I'm not an english speaking man. there will be typos and poor grammar. I would apreciate anybody who corrects them and add more information.)