Chilkat2 for PHP — Downloads

Chilkat2 for PHP is the PHP-style Chilkat API: the chilkat2 extension, with classes in the Chilkat2 namespace (Chilkat2\Http, Chilkat2\JsonObject, …), real PHP properties ($http->ConnectTimeout = 10), methods that throw Chilkat2\Exception when they fail, typed signatures that work with declare(strict_types=1) and named arguments, and progress callbacks you write as closures. HTTP and REST, email, FTP, SFTP, SSH, zip, encryption, signatures, certificates, XML, JSON, sockets and more, for PHP 8.1 through 8.5 on Windows, Linux, Alpine Linux and macOS.

Chilkat2 PHP or the classic Chilkat PHP extension? Both use the same Chilkat engine and have the same classes and functionality. Chilkat2 PHP (new Chilkat2\Http(), $http->QuickGetStr($url), exceptions, no file to include) is for new code. The classic extension (include "chilkat.php", new CkHttp(), status codes) is unchanged and remains on the Chilkat PHP downloads page; the two are separate extensions (chilkat and chilkat2) and can be installed side by side. See the differences.

Jump to: Which download? · Windows · Linux · Alpine Linux · macOS · Getting started · Web servers & Docker · The API in brief · Troubleshooting

Documentation & Samples

Which download do I need?

A PHP extension is built for one PHP minor version (8.1, 8.2, …), for non-thread-safe (NTS) or thread-safe (ZTS/TS) PHP, and for one OS and CPU architecture. All three must match the PHP that will load it. Ask that PHP:

php -r 'echo PHP_MAJOR_VERSION, ".", PHP_MINOR_VERSION, PHP_ZTS ? " ZTS" : " NTS", " ", php_uname("m"), "\n";'   # Linux, macOS
php -r "echo PHP_MAJOR_VERSION, '.', PHP_MINOR_VERSION, PHP_ZTS ? ' TS' : ' NTS', ' ', PHP_INT_SIZE * 8, '-bit', PHP_EOL;"   :: Windows

A web server may run a different PHP than the command line: check phpinfo() (“PHP Version”, “Thread Safety”, “Architecture”) when in doubt.

Windows

  • NTS, 64-bit→ chilkat2-php-8.x-nts-x64
  • Thread-safe, 64-bit→ chilkat2-php-8.x-x64
  • 32-bit→ …-win32

NTS: IIS/FastCGI and most command-line installs. Thread-safe: Apache with mod_php.

Linux (glibc)

  • NTS→ chilkat2-php-8.x-<arch>-linux
  • ZTS→ chilkat2-php-zts-8.x-<arch>-linux

x86_64, x86, aarch64 (arm64), armv7l. Distribution packages, PHP-FPM and the official php Docker images are NTS.

Alpine Linux (musl)

  • NTS→ chilkat2-php-8.x-<arch>-alpine

x86_64, aarch64. For Alpine packages and php:*-alpine Docker images. The glibc builds do not load on Alpine.

macOS

  • NTS→ chilkat2-php-8.x-<arch>-macosx
  • ZTS (8.2+)→ chilkat2-php-zts-8.x-<arch>-macosx

arm64 (Apple silicon), x86_64 (Intel). Homebrew's PHP is NTS.


Windows

Each .zip contains a code-signed php_chilkat2.dll, linked with the C runtime statically (no Visual C++ redistributable needed). Getting started →

Non-thread-safe (NTS)

v11.7.0 • 11-Nov-2026 • sha256: cc8a7e05b9d303f43687d3e8a5fd50fb5251229c7c80310c1ccecf453eaddac4
Chilkat2 PHP NTS 8.5.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 7a57c39b6c1a377d51ba587e5bf7c1ea645d262a367d05f96fd6d8b56d0e169d
Chilkat2 PHP NTS 8.5.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 87301e9d3981f359dc287386ebc2b4a272088bf139893f6f83715c0033ba60f4
Chilkat2 PHP NTS 8.4.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: bafcb05031d4743f16257ca6e2d211351060e45a33332fd7fccbd1b3cb764834
Chilkat2 PHP NTS 8.4.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 44ca4bad5979faa0ab35727506b977c5dd17b1605664f882f859fde86cb01938
Chilkat2 PHP NTS 8.3.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 40a47e9b231d29eec63aaad465f1fb144b6fac915126b86c82aed854549e0c63
Chilkat2 PHP NTS 8.3.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 9f25cb2c4fb077c19d8cdaf530e7b672f2c18c5a2056d49ad895fd840ee17380
Chilkat2 PHP NTS 8.2.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: acb25067728b014969f5c6c7759e6e042239d0b9af90b960b05698aac5462b4b
Chilkat2 PHP NTS 8.2.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 80b974682d3fd39dd42e581916a99b4366aceb57b2ec4b4fdeed3f455e094383
Chilkat2 PHP NTS 8.1.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 4db7cc96c18ab0fd21a13704c3589375cc310098017f5cf5e964575e8dceccb3
Chilkat2 PHP NTS 8.1.* 32-bit

Thread-safe (TS)

v11.7.0 • 11-Nov-2026 • sha256: ec89fbf84939561c8456ef9daffa188fad5f7fca435c7d31e478dd632905b7ce
Chilkat2 PHP 8.5.* (thread-safe) 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 65820322212df891543261f42a6ab5c8e579f4806c1d3e5f94b567ca62a18a63
Chilkat2 PHP 8.5.* (thread-safe) 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 0a136109b54be1199dd3e5b1b672c1017ae227a903307f04b000dbed11ea533e
Chilkat2 PHP 8.4.* (thread-safe) 64-bit

v11.7.0 • 11-Nov-2026 • sha256: b4247b5ca15b0d1ce81740dc04032518b62bee4779fb922b8881a40628bbf571
Chilkat2 PHP 8.4.* (thread-safe) 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 62566c716fbd257c6eaf7a98ba8f451f513cacbd6a127df223e0b6c2eaaa913e
Chilkat2 PHP 8.3.* (thread-safe) 64-bit

v11.7.0 • 11-Nov-2026 • sha256: fec7c545979ddeeae556039034ffca8b02d8b690519ec20de336708be8fd1944
Chilkat2 PHP 8.3.* (thread-safe) 32-bit

v11.7.0 • 11-Nov-2026 • sha256: d7e9c3423ca4cf212101838280896db6cd02e8a443422d4827e9de7789a0ba2d
Chilkat2 PHP 8.2.* (thread-safe) 64-bit

v11.7.0 • 11-Nov-2026 • sha256: bc332af859c548b057e897dfa71544f96a1a01d67ee330655b19bec1a0a05830
Chilkat2 PHP 8.2.* (thread-safe) 32-bit

v11.7.0 • 11-Nov-2026 • sha256: a68d39535663489350efbd8cc16bdc8862fcee53b4868f23fdbd27c81bd32af3
Chilkat2 PHP 8.1.* (thread-safe) 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 6928677b19c5edfd19c5e1eaa78bb4d7fb476b4eb987f9cca977b88b62d2629b
Chilkat2 PHP 8.1.* (thread-safe) 32-bit


Linux (x86_64, x86, arm64, armv7l)

For glibc-based distributions (Debian/Ubuntu, RHEL/Fedora, SUSE, Arch, Raspberry Pi OS, …). Each .tar.gz contains chilkat2.so. Alpine Linux uses musl and needs the Alpine downloads below. The arm64 and armv7l builds start at PHP 8.2. Getting started →

Non-thread-safe (NTS) — the usual build

v11.7.0 • 11-Nov-2026 • sha256: d58f61f1ff80e6d87964277f86bf0b715a4252c0bdcb4949d6e081f73ada215e
Chilkat2 PHP 8.5.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: dbf2205cc296eebe4a1d715a7e590c10894694b0393434f746f1914d3511f3ff
Chilkat2 PHP 8.5.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: f75fa1c395f024869e8d96ebd4f651f84c2419ab1b57e634f7085f114894d852
Chilkat2 PHP 8.5.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 9e04931b0fab9d077635f90d46794a16fc5f85236289cbce274bc2e456bebe91
Chilkat2 PHP 8.5.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: 5f18792f9d4f8a8ed7121163015ffe50715ec4f955bfc50107b236bba9bfbf9e
Chilkat2 PHP 8.4.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 3a85898bfece5f80d9202e209d8ca87fca950ee4719ac9dc9f9358a2936d148b
Chilkat2 PHP 8.4.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 4e587b588030ecac29699d5df15ebfe96417d6f15bfdcbe803346559b7508067
Chilkat2 PHP 8.4.* arm64

v11.7.0 • 11-Nov-2026 • sha256: cf538b680cc317e08e8a092f724e118bf8c9edce238207f2d2e9e6eab3b7cac8
Chilkat2 PHP 8.4.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: e52f7b7ce1cca3de6c61b436596975d9cd70db9515ec509092c7c724f4f1f116
Chilkat2 PHP 8.3.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: c423b5fd0e642d6d493ca2c3ab77841bedd34af12be51c503d72b6dc72765d1b
Chilkat2 PHP 8.3.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: e88843d31a006a5ef6551f8f259d5c141c2b1a15aa0878141cb1bdcb4ff3f647
Chilkat2 PHP 8.3.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 1f818c9612e0c3b70da91a741436ee2ea772a62ebf182e1e3d6ebd67d8a6ccc5
Chilkat2 PHP 8.3.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: 3b43bf08582afe0b19c006c00625c27b26e2442b3a972e82befb88dae24e183d
Chilkat2 PHP 8.2.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 44a8042d77fed68d6bc7710e81253ec73f076a86601afda631ebd6db7bc220f2
Chilkat2 PHP 8.2.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 42127b91d5820c91e566980a7ec68eea44efa9a9d7170f61ad6b3d57c83324c8
Chilkat2 PHP 8.2.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 41a33a94f863df08104680e063479e91f0d2f3d044fed5eddabb600e34dafa56
Chilkat2 PHP 8.2.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: f72abc3fdf45d9d117d40d6babcb8cba1be1ee080e59717b906dd5c0c36ecf1c
Chilkat2 PHP 8.1.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 42e999b824457fd42111f0c97d8bf94012e02dda9621709a3d253d08c88e73b8
Chilkat2 PHP 8.1.* 32-bit

Thread-safe (ZTS)

v11.7.0 • 11-Nov-2026 • sha256: 9663e36acf029dcb935c811a02108e8ac67fcb958241b89ad5da065f02c2a15e
Chilkat2 PHP (ZTS enabled) 8.5.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 0e00efbd553eca45689d185c611b600f7a02c86f4999b56b1f0c8baae29163f5
Chilkat2 PHP (ZTS enabled) 8.5.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 7642e882c48729ce56b16401da3e43d433920f8d3ae975352d9a380ac8ff8e7c
Chilkat2 PHP-ZTS 8.5.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 069a7380190b23935db8ee47e0b7aff62c3e25f41084e4885628b76bc867b7e9
Chilkat2 PHP-ZTS 8.5.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: 162b230073ba1821a3a593df1a0dc20a2ada1d2144ad6e4a7a90afa4888318fb
Chilkat2 PHP (ZTS enabled) 8.4.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 44ddee3fbe43dd2a618850196defdece8d4a60b4d5673a9eed16e4465feedd91
Chilkat2 PHP (ZTS enabled) 8.4.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 5ef407fad39f1178caddd132494ae2d07001385d393b78e1dba072e161f26d9c
Chilkat2 PHP-ZTS 8.4.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 57025f6503a3e3a4673c31118219a1f7105a58b0e7db1a1f32dfb228a79bb248
Chilkat2 PHP-ZTS 8.4.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: ef4da18a0e2e62d3f39352d7072ba20a9b987b5324b2bf09886314909a80a16b
Chilkat2 PHP (ZTS enabled) 8.3.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: b4b9297f377a9011e76b3fe207269c64858a9d0a773d4d85e3e49e0a92b777aa
Chilkat2 PHP (ZTS enabled) 8.3.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: f71946e4d98f879ba739896c5302f266dbf2d0b95190747c8daba70a599a13cf
Chilkat2 PHP-ZTS 8.3.* arm64

v11.7.0 • 11-Nov-2026 • sha256: b95f95dca0e8f04d34355818bfef5ab976ac8fe77bf6fc8d5d6eb84df6440230
Chilkat2 PHP-ZTS 8.3.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: c551ed160a825b5745e6024d9589ec3f33241e7814b87114e270db29d47bb95a
Chilkat2 PHP (ZTS enabled) 8.2.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: dab8816969bc2ff362b814ea6b214377f49a242516624412271cc1035ddb4cfa
Chilkat2 PHP (ZTS enabled) 8.2.* 32-bit

v11.7.0 • 11-Nov-2026 • sha256: 505700213e48b23875f1aa1f28eba794fa8f0e8ca9071fe526f183b81d482069
Chilkat2 PHP-ZTS 8.2.* arm64

v11.7.0 • 11-Nov-2026 • sha256: a4722563af94f6234109bde48646419af0692bc2cd99d7fac8ddb3746690a11b
Chilkat2 PHP-ZTS 8.2.* armv7l

v11.7.0 • 11-Nov-2026 • sha256: 2ee728fd05717fd4bb2ef536cf7c95454a9440d6b9f5bff462caf21eaae8a4ec
Chilkat2 PHP (ZTS enabled) 8.1.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: dee387d7dd45e1f31121944d03769a8c9aaa82affd5a136d221e1ecaa38f6caf
Chilkat2 PHP (ZTS enabled) 8.1.* 32-bit


Alpine Linux (x86_64, arm64)

Built for musl, non-thread-safe. Each .tar.gz contains chilkat2.so. Getting started →

v11.7.0 • 11-Nov-2026 • sha256: cb1fe1e263f6b9f9f833aea818c7822df2dd41c139d2539c531b5c35f92593bf
Chilkat2 PHP 8.5.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 7eaadc79a5e639d9f24fa6b509c2e0fece8a93c8f50f53faba5bbe928c74e9c2
Chilkat2 PHP 8.5.* arm64

v11.7.0 • 11-Nov-2026 • sha256: e416a1da8cd4e8c5cbb6c4eb5695420b2e295b4971e2b140f2eaf288da434e16
Chilkat2 PHP 8.4.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 33bf71155012b38fb664946c3b913e02e6e776c4cf4e224434c0b865dde8d4fc
Chilkat2 PHP 8.4.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 997d765811da537caed15cededa24cfa78fbf72cd61415e177f67f477be5952b
Chilkat2 PHP 8.3.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: b5f2cd1a9120f1f57b953470e72373a9b2e757dc191b592a1281eea133300585
Chilkat2 PHP 8.3.* arm64

v11.7.0 • 11-Nov-2026 • sha256: 3724c38b5032ded390a097807cccb89719cd27c3af6b48ec20299adfde2322ef
Chilkat2 PHP 8.2.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: 4675d19adaa1b5db64a870ef0d4cff1b621dc3434ab0242fcf68fd015f2c0d45
Chilkat2 PHP 8.2.* arm64

v11.7.0 • 11-Nov-2026 • sha256: cb7b21c0b46c8cd938a95edd20af5948df0b4b74f102245bced2f4e2fc57e08b
Chilkat2 PHP 8.1.* 64-bit

v11.7.0 • 11-Nov-2026 • sha256: b7a1053dce5c6cc5fa6a5e1dd63e2004abacb6680bf17ccb2c7d264debc21c6d
Chilkat2 PHP 8.1.* arm64


macOS (arm64, x86_64)

Each .tar.gz contains a code-signed chilkat2.so. Apple silicon requires macOS 11 or later; Intel requires macOS 10.14 or later. Getting started →

Non-thread-safe (NTS) — the usual build (Homebrew)

v11.7.0 • 11-Nov-2026 • sha256: 6a8ae1f43f21300b52994015ff6587c2ecb2d3bb9465d0744fcf35e7c2f319f7
Chilkat2 PHP 8.5.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 89a9b96273d576d4d8e7e2620f7bb88802194ed3784eb5be6f51de9ebc85468b
Chilkat2 PHP 8.5.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: c85589d46676f5ea133c78626601454c5f374d39b91a013c1b0ea92cdbda7020
Chilkat2 PHP 8.4.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: ed7b26847c61baeb7d7f4ee239700e2f68b0da652fae46bf2da52e7c18ab3d40
Chilkat2 PHP 8.4.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 4e48cfaeb2f6c6a942c74964dc965a9f2852777960220f8e8fbe23ec14ba13f9
Chilkat2 PHP 8.3.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 8d19c2f96a439882dc377a1380cdbf07f3b6d860447455d82b101887ad071dba
Chilkat2 PHP 8.3.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: e67fb84469f34e9155f3d1a8ea6754d3b7a7e5ad552b164111d376127945d057
Chilkat2 PHP 8.2.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 6b4c1cdb2a4754df6a52f4d80d1b95d2ccc9401700797e887bd5a3e1e5ff16ae
Chilkat2 PHP 8.2.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: e7e07930e289ccb158aa7db7b16562d04aaac9d8219b00022350d2d7907d8e83
Chilkat2 PHP 8.1.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 838fdccde88f63ff4df3b5f1d4a95e5c010b126eafb0eca86719b4cc4119db08
Chilkat2 PHP 8.1.* x86_64 Extension

Thread-safe (ZTS)

v11.7.0 • 11-Nov-2026 • sha256: 3caf9ea237bcd4129cd384071c6ede941c2ff29a5c21ad902eb6c7344e3acf8e
Chilkat2 PHP-ZTS 8.5.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 31a861ab54e7a9542f6e54cee989eadb05d5b60abbbcf5b820d105f443d70c57
Chilkat2 PHP-ZTS 8.5.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 08514437b3fc0953d386fec7d0d538d7b4b3d76dd1bbd5dd3ff5b3a0c095bb40
Chilkat2 PHP-ZTS 8.4.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: b72587b732a1549f5306fc41fb4e73f1e8ff13f595ff87024d6eb4426235f2ac
Chilkat2 PHP-ZTS 8.4.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: ede3d4098f7e2d6180b8af3323cffe6be529955537d8f697cc37db53162731e8
Chilkat2 PHP-ZTS 8.3.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: c0e107fa6b61c1c63c68db0c83938b64bcc53956a90ea26bdc3b38bcc5d59604
Chilkat2 PHP-ZTS 8.3.* x86_64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 9f8917633b2caabefdebad54cf88566d6e3b170582e0f2cb9ff442bba4e3eed2
Chilkat2 PHP-ZTS 8.2.* arm64 Extension

v11.7.0 • 11-Nov-2026 • sha256: 05c271841eaff0217b18a89bb4f0dc75185bb146b856f674fb0cc09a6d439296
Chilkat2 PHP-ZTS 8.2.* x86_64 Extension


Getting started

The steps are the same on every operating system; only the archive and the file name differ (php_chilkat2.dll on Windows, chilkat2.so elsewhere).

  1. Download and extract

    tar xzf chilkat2-php-8.4-x86_64-linux.tar.gz       # Linux / Alpine / macOS (your file name)
    # Windows: right-click the .zip → Extract All, or:
    tar -xf chilkat2-php-8.4-nts-x64.zip                # Windows 10 and later include tar

    macOS only: if the browser added a quarantine attribute, clear it so Gatekeeper does not block the extension:

    xattr -dr com.apple.quarantine chilkat2-php-8.4-arm64-macosx
  2. What's in the download

    chilkat2-php-<version>-<platform>/
    ├─ chilkat2.so              the extension (php_chilkat2.dll on Windows)
    ├─ chilkat2.stub.php        for your IDE and static analysis — never include it
    ├─ README.txt
    ├─ test.php                 a small check that everything loads
    └─ license.pdf, THIRD-PARTY-NOTICES.txt, … and a software bill of materials (chilkat.cdx.json)
  3. Try it without installing

    From the extracted folder:

    php -d extension=./chilkat2.so test.php             # Linux, Alpine, macOS
    php -d extension=.\php_chilkat2.dll test.php         :: Windows

    test.php prints the Chilkat version, encrypts and decrypts a string, and round-trips some UTF-8 text. If the extension cannot be loaded, it prints the PHP version, thread safety and php.ini it found; see Troubleshooting.

  4. Install

    Copy the extension into PHP's extension directory:

    php -r 'echo ini_get("extension_dir"), "\n";'       # where it goes
    sudo cp chilkat2.so "$(php -r 'echo ini_get("extension_dir");')"
    :: Windows: copy php_chilkat2.dll into the "ext" folder of your PHP

    Then enable it: add a line to php.ini, or (Linux, macOS) to a file of its own in the conf.d directory that php --ini lists, for example 20-chilkat2.ini:

    extension=chilkat2

    Check with php -m (the list includes chilkat2) and php test.php. phpinfo() shows a chilkat2 section with the Chilkat version.

  5. Unlock

    Chilkat is fully functional for a 30-day trial. Call UnlockBundle once when your program starts; any string starts the trial, and your purchased unlock code is used the same way:

    (new Chilkat2\GlobalSettings())->UnlockBundle('Anything for 30-day trial');

A first program

<?php
declare(strict_types=1);

use Chilkat2\GlobalSettings;
use Chilkat2\Http;

(new GlobalSettings())->UnlockBundle('Anything for 30-day trial');

try {
    $http = new Http(['ConnectTimeout' => 10]);        // properties may be set in the constructor
    $http->onPercentDone(function (int $pct): bool {
        echo "$pct%\n";
        return false;                                  // true aborts the download
    });

    $html = $http->QuickGetStr('https://www.chilkatsoft.com/');
    echo "HTTP {$http->LastStatus}, ", strlen($html), " bytes\n";
} catch (\Chilkat2\Exception $e) {
    echo "{$e->getClass()}::{$e->getMethod()} failed\n";
    echo $e->getMessage(), "\n";                        // the full LastErrorText of the failed call
}

There is nothing to include: the classes exist as soon as the extension is loaded. For your IDE, put chilkat2.stub.php where it indexes files (PhpStorm: anywhere in the project or as an external library; VS Code + Intelephense: in the workspace or in intelephense.environment.includePaths).


Web servers & Docker

PHP-FPM, Apache (mod_php) and IIS (FastCGI) each read their own php.ini, which may differ from the command line's: enable extension=chilkat2 in the one phpinfo() shows under “Loaded Configuration File” (or in its conf.d directory), then restart the service (systemctl restart php8.4-fpm, apachectl graceful, recycle the IIS application pool).

Official php Docker images

Copy the build matching the image's PHP version (Debian-based images: -linux; php:*-alpine: -alpine) and enable it with the image's helper:

FROM php:8.4-fpm
COPY chilkat2-php-8.4-x86_64-linux/chilkat2.so /tmp/
RUN mv /tmp/chilkat2.so "$(php -r 'echo ini_get("extension_dir");')/" \
 && docker-php-ext-enable chilkat2

The php:*-zts images need the ZTS builds.


The API in brief

Same classes, same members, same behavior as every other Chilkat product.

Chilkat2 PHPClassic Chilkat PHP
Loadingextension=chilkat2; nothing to includeextension=chilkat plus include "chilkat.php"
Classesnew Chilkat2\Http()new CkHttp()
Properties$http->ConnectTimeout = 30;$http->put_ConnectTimeout(30);
Methods$http->QuickGetStr($url)$http->quickGetStr($url)
Failurethrows Chilkat2\Exception (getMessage() is the LastErrorText); or, with ['RaiseError' => false], returns false / nullreturns false / null; read lastErrorText()
“Not found”lookup methods such as $xml->FindChild($path) return null, no exceptionreturns null
Yes/no methods$json->HasMember($path) returns bool, never throwsreturns bool
Strings and bytesPHP strings (UTF-8 text, or binary data as is)also CkString, CkByteData; put_Utf8(true)
Typestyped parameters and properties: TypeError on a wrong type, named arguments, strict_typesuntyped
Progress eventsonPercentDone(fn), onAbortCheck(fn), onProgressInfo(fn) with closures—
Async (*Async, Task)not includedincluded
Unlocking(new Chilkat2\GlobalSettings())->UnlockBundle($code)(new CkGlobal())->UnlockBundle($code)

Events run during the method call; returning true from an onAbortCheck or onPercentDone closure aborts the method (it then fails in the usual way). AbortCheck fires every HeartbeatMs milliseconds, which is how a script limits a long call: PHP's set_time_limit() does not interrupt a Chilkat method.


Troubleshooting

PHP Startup: Unable to load dynamic library 'chilkat2'
The file is not in extension_dir (or the path after extension= is wrong). On Windows, the message ending in “is not a valid Win32 application” means a 32-bit/64-bit mismatch; on Linux, “wrong ELF class” is the same, and “Error loading shared library” or a missing ld-linux means a glibc build on Alpine (or the reverse).
Module compiled with module API=2023… / PHP compiled with module API=2024…
The download is for a different PHP minor version: use the one for PHP_MAJOR_VERSION.PHP_MINOR_VERSION (above).
Module compiled with build ID=API…,NTS / PHP compiled with build ID=API…,TS
Thread-safety mismatch: a ZTS/TS PHP needs the ZTS/TS download, an NTS PHP the NTS one.
Class "Chilkat2\Http" not found
The extension is not loaded in the PHP that runs the script — often a web server reading a different php.ini than the command line (above). extension_loaded('chilkat2') tells.
macOS: the extension “cannot be opened” or fails a code-signature check
Clear the download's quarantine attribute: xattr -dr com.apple.quarantine <extracted folder>.
Error: Undefined property: Chilkat2\Http::$Conecttimeout
Property names are case-sensitive and checked: a misspelled name is an error rather than a silent new property.
Class "Chilkat2\CodeSign" not found on Linux or macOS
CodeSign and ScMinidriver use Windows APIs and exist only in the Windows builds.