Download the PHP package lucasacoutinho/ext-clickhouse without Composer
On this page you can find all versions of the php package lucasacoutinho/ext-clickhouse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucasacoutinho/ext-clickhouse
More information about lucasacoutinho/ext-clickhouse
Files in lucasacoutinho/ext-clickhouse
Package ext-clickhouse
Short Description Native TCP ClickHouse client extension for PHP.
License MIT
Informations about the package ext-clickhouse
ext-clickhouse
A native ClickHouse client for PHP. It speaks the native TCP protocol and
ships the C++ client inside clickhouse.so.
Getting started
Install the extension with PIE:
Enable it in php.ini:
Create a client and check the connection:
The driver connects to ClickHouse over its native TCP port, usually 9000.
It supports LZ4 and ZSTD compression, TLS, typed columns, inserts, and
block-by-block result streaming without an HTTP or cURL transport.
Requirements
| Component | Supported version |
|---|---|
| PHP | 7.4 through 8.5 |
| Compiler for source builds | GCC 8+, Clang 7+, or another C++17 compiler |
| ClickHouse C++ client | Bundled with the extension |
CI builds and tests every supported PHP version.
On PHP 8.1+, ClickHouse\Driver\CompressionMethod and
ClickHouse\Driver\Type are native backed enums. PHP 7.4 and 8.0 expose the
same names as final classes with integer constants. Code can use constants
such as CompressionMethod::LZ4 on every supported PHP version. Methods that
return Type return integer constants on PHP 7.4 and 8.0, and enum cases on
PHP 8.1+.
Working with data
The public PHP API is declared in
clickhouse.stub.php.
TLS
Pass an SSL option array as the 15th ClientOptions constructor argument.
When SSL is enabled, the client uses system CA locations and SNI unless the
options override them.
Build from source
Clone the initialized submodule, then use the standard PHP extension build flow:
If the repository was cloned without --recursive, initialize the dependency
before building:
Docker
Versioned and rolling images are published for each supported PHP release:
Build the image locally with a different PHP version when needed:
Bundled clickhouse-cpp
The repository pins clickhouse-cpp as a git submodule and compiles it into
clickhouse.so. Users do not install or link a separate system copy.
phpinfo() reports the embedded client version.
The v1.6.2 release reports clickhouse-cpp v2.6.2 and pins upstream commit
cdc6dfc2980826560bfdbd06e937c7a01a495209. This post-tag snapshot preserves
DateTime timezone metadata, validates array element types and compressed block
sizes, flushes the handshake addendum before the first query, and reports
premature socket EOF as a protocol error. It also rejects unbalanced and
overly nested type names, reads the ProfileInfo flags as bytes, zeroes
ServerInfo fields missing from a server Hello, and names the CA file or
directory when loading it fails.
The build explicitly preserves native Bool values, Abseil-backed wide integers,
and the optional C++ endpoint API. Rebuild ext-clickhouse-pdo against this
revision and use matching 1.6.x native extensions because both modules share
C++ types.
The submodule SHA is part of the extension source and release contract. New pins should prefer upstream tags. A post-tag pin must document the fixes it needs and pass the full PHP matrix. Source archives include the initialized submodule so PIE can build without running git commands.
Extension releases use their own version numbers. A dependency-only bug fix or security update can be a patch release. Observable protocol, type, or TLS changes require a minor release. PHP API or ABI breaks require a major release.
Testing
Run the PHPT suite against a live ClickHouse server:
The GitHub Actions matrix also runs integration tests, sanitizers, coverage, formatting, and clang-tidy on every supported PHP version.
Contributing
Bug reports and focused pull requests are welcome. Open an issue with the PHP version, ClickHouse version, and a minimal reproduction for driver problems.
License
MIT