Berikut adalah cara untuk mengkoneksikan PHP ke database Firebird
1. Install Xampp2. Install Database Firebird
3. Create Database Firebird
4. Copy file fbclient.dll (c:\firebird\bin\fbclient.dll) ke direktory c:\Windows\System32, dan rename file tersebut menjadi gds32.dll
5. Copy file fbclient.dll (c:\firebird\bin\fbclient.dll) ke direktory c:\Windows\System32
6. Copy file fbclient.dll (c:\firebird\bin\fbclient.dll) ke direktory c:\xampp\php
7. Edit file php.ini (c:\xampp\php\php.ini), hilangkan tanda semicolon(;) pada ;extension=php_interbase.dll menjadi extension=php_interbase.dll
8. Jalankan form system melalui Control Panel >> system >> advance system setting, pilih tab advance >> Environment Variable, Perhatikan pada frame System Variable :
a. New : Isi Variable Name = PHPRC dan Variable Value = c:\xampp\php (merupakan path php)
b. Edit Path : tambahkan ;c:\xampp\php pada akhir value
9. Restart Apache
10. Buat file connfb.php di folder htdocs dan isi dengan sourcecodenya dengan :
$db = "localhost:(path database disimpan)";
$user = "SYSDBA"; //username database
$password = "masterkey"; //password
if ($db1 = ibase_connect($db, $user, $password)) {
echo "Connected to the database.";
ibase_close($db1);
} else {
echo "Connection failed.". ibase_errmsg();
}
No comments: