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.

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 ext-clickhouse

ext-clickhouse

A native ClickHouse client for PHP. It speaks the native TCP protocol and ships the C++ client inside clickhouse.so.

Build status Packagist version MIT license

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


All versions of ext-clickhouse with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4 <8.6
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 lucasacoutinho/ext-clickhouse contains the following files

Loading the files please wait ...