Jump to content


jacob lee

Member Since 09 Aug 2007
Offline Last Active Aug 19 2008 05:43 AM
-----

Topics I've Started

Why double "B"oard?

07 July 2008 - 11:48 PM

I'm just wondering why double "B"oard is used :) . The Uniform Server BBoard. Is there any reason for that? :)

Firebird support

23 March 2008 - 07:37 AM

Recently I just had success on installing Firebird on the uniform server. If you want to use firebird as your database engine this article might give you a method if you don't know how to.

1. download firebird server uninstall version and uncompress the zip to the uniform server\udrive\usr\local and change the newly created folder name to firebird.

2. set folder where you save firebird database files. I set up like this: \udrive\var\firebird

3. 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

4. under that line write down:
start \usr\local\firebird\bin\fbserver.exe -a
(it means we run firebird as an application not a service)

5. save the file.

6. check whether you have php_interbase.dll in your php extension folder. if not you have to get it from php.net. if you want to use pdo then you need php_pdo_firebird.dll also.

7. open php.ini and find extension option and add: extension=php_interbase.dll
if you want to use pdo then add also: extension=php_pdo_firebird.dll

8. add to php.ini:
[InterBase]
ibase.allow_persistent PHP_INI_SYSTEM
ibase.max_persistent PHP_INI_SYSTEM
ibase.max_links PHP_INI_SYSTEM
ibase.default_db PHP_INI_SYSTEM
ibase.default_user PHP_INI_ALL
ibase.default_password PHP_INI_ALL
ibase.default_charset PHP_INI_ALL
ibase.timestampformat PHP_INI_ALL
ibase.dateformat PHP_INI_ALL
ibase.timeformat PHP_INI_ALL

9. "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"

10. save php.ini

11. open stop_server.bat and find the line:
udrive\home\admin\program\pskill.exe Apache.exe c

12. add under that line:
udrive\home\admin\program\pskill.exe fbserver.exe c
(there is no way except we shutdown the server by using the tray icon. so we use pskill to kill the process by force.)

13. download the ibWebAdmin from sourceforge.net and unzip to ..\udrive\home\admin\www

14. 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/');
=> for here we created \var\firebird folder!

define('DEFAULT_HOST',	'localhost');

define('DEFAULT_CACHE',   8192);
=> for better caching

define('DEFAULT_SERVER',  'FB_2.0');

$ALLOWED_DIRS = array('/var/firebird/',
					  '/tmp/');
define('BACKUP_DIR', '/var/firebird/backup/');
=> for this I created \var\firebird\backup folder!

14. save configuration.inc.php

15. 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

TempDirectories = /tmp

DefaultDbCachePages = 8192

(be careful when you define the DatabaseAccess, it should have the drive letter "W:", otherwise the firebird gives you error.)

16. save firebird.conf

17. open ..\udrive\home\admin\www\includes\tool.inc and find line:
<a target="_phpmyadmin" onclick="h(this);" href="<?=$apanel?>/phpMyAdmin/"><?=$US['nav-pma']?></a>

18. add next :
<a target="_ibwebadmin" onclick="h(this);" href="<?=$apanel?>/ibWebAdmin/"><?=$US['nav-ibwa']?></a>

19. 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>

20. 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>

21. 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\"";
}
22. add next:
$res = system "\\home\\admin\\program\\pskill.exe", "fbserver.exe";

if ($res == 0){
	  system "/home/admin/program/pskill.exe fbserver.exe c";
}

23. save sserver.cgi

24. make rfirebird.cgi file in the same folder and the contents are:

#!/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";
}

25. make sfirebird.cgi file in the same folder and the contents are:

#!/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";
}

26. open \udrive\home\admin\www\includes\lang\en.php add in the code:
'nav-rfirebird' => 'Run Firebird',
	'nav-sfirebird' => 'Stop Firebird',

	'nav-ibwa' => 'ibWebAdmin',
Still you need to learn how to use firebird becuase it is quite different from mysql.