Download the PHP package satwareag/php-firebird without Composer

On this page you can find all versions of the php package satwareag/php-firebird. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-firebird

PHP Firebird Extension (Modernized)

CI PHP 8.2+ Ask DeepWiki

A high-performance PHP extension providing native connectivity to Firebird databases. This modernized version targets PHP 8.2+ with C++17 standards and comprehensive development tooling.

⚠️ Breaking Changes in v7.0: This version uses fbird_* function names (not ibase_*) and builds as firebird.so (not interbase.so). See the Migration Guide for upgrade instructions.

Features

API Layers

This extension provides three complementary API layers:

Feature PDO_Firebird (bundled) pdo_fbird (Layer 3) Firebird\* (Layer 2) fbird_* (Layer 1)
API Style PDO (agnostic) PDO (agnostic) OOP (Firebird-specific) Procedural
DSN prefix firebird: fbird: N/A N/A
Events Support ❌ No ✅ Yes (Attributes) ✅ Yes ✅ Yes
Service API ❌ No ✅ Yes (Attributes) ✅ Yes ✅ Full
Array Fields ❌ No ✅ Yes (Read/Write) ❌ No ✅ Yes
BLOB Streaming ✅ Via LOB ✅ Via LOB ✅ Native ✅ Native + Streams
Prepared Statements ✅ Yes ✅ Yes ✅ Yes ✅ Yes
Transaction Control ✅ Basic ✅ Full (Isolation) ✅ Advanced ✅ Advanced (TPB)
Named Cursors ❌ No ✅ Yes (Scrollable) ❌ No ✅ Yes
Generator/Sequence Via SQL only lastInsertId() Via SQL only fbird_gen_id()
Modern OO API ❌ Legacy C API ✅ FB 3.0+ OO API ✅ FB 3.0+ OO API ✅ FB 3.0+ OO API
Exception Mode ✅ Always ✅ Always ✅ Always ✅ Optional (v9+)

When to use pdo_fbird (Layer 3):

When to use Firebird\* classes (Layer 2):

*When to use `fbird_` functions (Layer 1):**

Requirements

System Requirements

⚠️ Firebird 3.0+ Client Library Required: This extension requires the Firebird 3.0+ client library (fbclient) for building, as it uses the modern OO API (FB_API_VER >= 30). Supported server versions: 3.0, 4.0, 5.0+.

Supported Platforms

Note: glibc 2.28+ required for glibc precompiled binaries; musl 1.2+ for Alpine binaries. PHP 8.2+ is required.

Precompiled Binary Matrix (v12.0.0+)

Platform Architectures PHP Versions Variants Bundles
Linux (glibc) x86_64, aarch64 8.2-8.5 NTS, ZTS 16
Linux (musl) x86_64 8.2-8.5 NTS, ZTS 8
macOS arm64 8.2-8.5 NTS, ZTS 8
Windows x64 8.2-8.5 NTS, TS 8

Download from the Releases Page.

Quick Start

Docker Development (Recommended)

Native Installation

Linux (Ubuntu/Debian)

Linux (openSUSE)

Linux / macOS (Pre-compiled Bundles)

Pre-compiled bundles include firebird.so with bundled Firebird client libraries ($ORIGIN/lib/ RPATH).

  1. Go to the Releases Page.
  2. Download the bundle matching your platform, PHP version, and thread safety (NTS/ZTS).
  3. Extract: tar -xzf php-firebird-*.tar.gz
  4. Copy firebird.so and lib/ to your PHP extension directory.
  5. Add extension=firebird.so to your php.ini.

Windows (Pre-compiled DLLs)

Pre-compiled Windows DLLs for PHP 8.2-8.5 (x64, NTS/TS).

  1. Go to the Releases Page.
  2. Download the .zip matching your PHP version and thread safety.
  3. See the Windows Installation Guide for detailed instructions.

Windows (Manual Build)

macOS (Homebrew)

Usage Example

Exception Handling

The extension provides PDO-style exception handling with runtime switchable error modes:

Exception Mode API:

Common SQLSTATE Codes:

Doctrine DBAL Integration: Exception mode is required for Doctrine DBAL 4.x compatibility. Enable THROW mode at application bootstrap:

Transactions Example

Advanced Transactions with TPB (Transaction Parameter Block)

The extension provides comprehensive transaction control via the Transaction Parameter Block (TPB):

Transaction Flags (combinable with |):

Flag Description
FBIRD_READ Read-only access mode
FBIRD_WRITE Read-write access mode (default)
FBIRD_CONCURRENCY SNAPSHOT isolation (repeatable read)
FBIRD_COMMITTED READ COMMITTED isolation
FBIRD_CONSISTENCY SERIALIZABLE isolation (table-level locks)
FBIRD_REC_VERSION Read latest committed version (with COMMITTED)
FBIRD_REC_NO_VERSION Read only version at transaction start
FBIRD_WAIT Wait for locked records
FBIRD_NOWAIT Fail immediately on lock conflict
FBIRD_LOCK_TIMEOUT Enable lock timeout (set value via array API)
FBIRD_READ_CONSISTENCY Firebird 4.0+ read consistency mode

Table Reservation Flags (for tables array option):

Flag Description
FBIRD_LOCK_SHARED Shared lock (other transactions can read)
FBIRD_LOCK_PROTECTED Protected lock (other transactions blocked)
FBIRD_LOCK_EXCLUSIVE Exclusive lock (no other access)
FBIRD_LOCK_READ Lock for reading
FBIRD_LOCK_WRITE Lock for writing

Prepared Statements Example

BLOB Handling Example

Configuration

Runtime Configuration

⚠️ Breaking Change (v7.0): INI settings have been renamed from ibase.* to fbird.*. Update your php.ini configuration accordingly. ⚠️ Breaking Change (v12.0): pdo_fbird is now a separate extension. Add extension=pdo_fbird.so to your php.ini (after firebird.so) to use the fbird: PDO DSN.

Supported Input Date/Time Formats

When binding date/time parameters, the extension auto-detects the following formats:

Date Formats (all cross-platform compatible): Format Example Description
ISO 8601 2025-12-17 YYYY-MM-DD (recommended)
European 17.12.2025 DD.MM.YYYY
US 12/17/2025 MM/DD/YYYY
Time Formats: Format Example Description
Basic 14:30:00 HH:MM:SS
With fractions 14:30:00.1234 Up to microsecond precision
With offset 14:30:00+01:00 Timezone offset (Firebird 4.0+)
With named zone 14:30:00 Europe/Berlin Named timezone (Firebird 4.0+)

Timestamp Formats: Combine any date format with any time format, separated by space or T:

Timezone Support (Firebird 4.0+):

Environment Variables

Migration Guide

Migrating from ext/interbase or Legacy php-firebird

This version uses the modern fbird_* function prefix instead of ibase_*. Here's how to migrate:

Function Name Changes

Old Name (ibase_*) New Name (fbird_*)
ibase_connect() fbird_connect()
ibase_pconnect() fbird_pconnect()
ibase_close() fbird_close()
ibase_query() fbird_query()
ibase_fetch_assoc() fbird_fetch_assoc()
ibase_fetch_object() fbird_fetch_object()
ibase_fetch_row() fbird_fetch_row()
ibase_free_result() fbird_free_result()
ibase_prepare() fbird_prepare()
ibase_execute() fbird_execute()
ibase_free_query() fbird_free_query()
ibase_trans() fbird_trans()
ibase_commit() fbird_commit()
ibase_commit_ret() fbird_commit_ret()
ibase_rollback() fbird_rollback()
ibase_rollback_ret() fbird_rollback_ret()
ibase_blob_create() fbird_blob_create()
ibase_blob_open() fbird_blob_open()
ibase_blob_add() fbird_blob_add()
ibase_blob_get() fbird_blob_get()
ibase_blob_close() fbird_blob_close()
ibase_blob_cancel() fbird_blob_cancel()
ibase_blob_info() fbird_blob_info()
ibase_blob_echo() fbird_blob_echo()
ibase_blob_import() fbird_blob_import()
ibase_errmsg() fbird_errmsg()
ibase_errcode() fbird_errcode()
ibase_affected_rows() fbird_affected_rows()
ibase_num_fields() fbird_num_fields()
ibase_num_params() fbird_num_params()
ibase_field_info() fbird_field_info()
ibase_param_info() fbird_param_info()
ibase_name_result() fbird_name_result()
ibase_drop_db() fbird_drop_db()
ibase_add_user() fbird_add_user()
ibase_modify_user() fbird_modify_user()
ibase_delete_user() fbird_delete_user()
ibase_service_attach() fbird_service_attach()
ibase_service_detach() fbird_service_detach()
ibase_backup() fbird_backup()
ibase_restore() fbird_restore()
ibase_maintain_db() fbird_maintain_db()
ibase_db_info() fbird_db_info()
ibase_server_info() fbird_server_info()
ibase_set_event_handler() fbird_set_event_handler()
ibase_free_event_handler() fbird_free_event_handler()
ibase_wait_event() fbird_wait_event()

Quick Migration Script

For simple projects, you can use search-and-replace:

Extension Loading Changes

Build Flag Changes

Resource Type Changes

Resource types have also been renamed for clarity:

Old Type New Type
Firebird/InterBase link Firebird link
Firebird/InterBase transaction Firebird transaction
Firebird/InterBase result Firebird result
Firebird/InterBase query Firebird query
Firebird/InterBase blob Firebird blob

Why the Change?

This extension was originally forked from PHP's ext/interbase. The rename to fbird_* functions:

  1. Reflects modern reality: InterBase is essentially defunct; Firebird is the active successor
  2. Clear differentiation: Makes it obvious this is a new, maintained driver
  3. Clean break: Encourages users to review and test their code during migration
  4. Future-proof: No confusion with legacy or potentially conflicting code

Testing

Running Tests

make test only loads firebird.so (the main extension). To test PDO functionality, use run-tests.php with explicit extension loading:

The CI runs 389 .phpt tests across 12 containers (PHP 8.2-8.5 x FB 3.0/4.0/5.0).

Test Environment Setup

Troubleshooting

Common Build Issues

Missing fbclient library:

PHP version conflicts:

Windows Visual Studio version:

Connection Behavior

Connection Reuse (Default Behavior):

By design, fbird_connect() reuses existing connections when called with identical parameters. This matches PostgreSQL's pg_connect() behavior and provides efficiency benefits for typical use cases:

When You Need Separate Connections:

If you need independent connections (e.g., for parallel transactions, different isolation levels, or connection-specific state), use one of these approaches:

Force New Connection (v7.0+):

Use the FBIRD_CONNECT_FORCE_NEW flag (value: 2) to bypass connection reuse and create a new database connection:

This flag mirrors PostgreSQL's PGSQL_CONNECT_FORCE_NEW behavior and is useful for:

Performance Optimization

Connection Pooling:

Prepared Statements:

Development

Contributing

See CONTRIBUTING.md for detailed development guidelines including:

Development Tools

Architecture

IDE and Static Analysis Support

For IDE autocompletion and static analysis tools (PHPStan, Psalm), install the stubs package:

This provides:

PHPStan Configuration

The stubs are automatically loaded via Composer. For explicit configuration in phpstan.neon:

Psalm Configuration

Add to your psalm.xml:

Function Reference

Connection Functions

Query Functions

Fetch Functions

Transaction Functions

Savepoint Functions

Transaction Constants

BLOB Functions

Information Functions

Database Administration

Service Functions

User Management

Event Functions

OOP Event API (v12.0+):

Batch Functions (Firebird 4.0+)

PHP Event Polling Wrappers (src/Firebird/)

For advanced timeout and non-blocking event handling, PHP wrapper classes are provided:

Available Strategies: Strategy Constructor Min Timeout Requirements
process ProcessEventPoller 10ms proc_open() (most reliable)
pcntl PcntlEventPoller 1000ms pcntl extension (Unix only)
fiber FiberEventPoller 1ms amphp/amp ^3.0
auto Auto-detect Varies Best available

See docs/oop-api.md for the Firebird\Event class reference.

Version Compatibility

Current Version: 13.2.6 (Stable Release)

Supported PHP Versions:

ℹ️ PHP 8.1: PHP 8.1 reached end-of-life on November 25, 2025 and is no longer supported as of v7.2.0. Please upgrade to PHP 8.2 or newer.

Firebird Client Library (for building):

Firebird Server Connectivity: Client Library Server Versions Supported Notes
FB 3.0 client FB 3.0 Legacy
FB 4.0 client FB 3.0, 4.0 Stable
FB 5.0 client FB 3.0, 4.0, 5.0+ Recommended

ℹ️ Firebird 2.5 Server: Firebird 2.5 reached EOL in September 2020 and is no longer supported as of v7.2.0. Please migrate to Firebird 3.0+.

Precompiled Binaries (v12.0.0+)

Starting with v12.0.0, we provide precompiled bundles across Linux (glibc + musl), macOS (arm64), and Windows. Both firebird.so and pdo_fbird.so are included:

Package Compatibility:

Installing PHP 8.2+ on Older Distributions:

If your distribution ships with PHP < 8.2, use these third-party repositories:

After installing PHP 8.2+, install the precompiled extension bundle matching your PHP version.

Dropped Support:

Security

⚠️ SQL INJECTION WARNING: Never concatenate user input directly into SQL queries. Always use parameterized queries.

SQL Injection Prevention

✅ SAFE - Always use parameterized queries:

❌ UNSAFE - Never do this:

Escaping Functions

For cases where parameterized queries cannot be used (dynamic SQL generation), use fbird_escape_string():

Note: fbird_escape_string() is a secondary defense. Parameterized queries are always preferred.

Security Features

For comprehensive security guidance, see docs/SECURITY.md.

Reporting Security Issues

For security-related issues, please email the maintainers directly rather than creating public issues.

License

This extension is licensed under the PHP License v3.01. See LICENSE for details.

Links



All versions of php-firebird with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package satwareag/php-firebird contains the following files

Loading the files please wait ...