Installing the Chilkat PHP Extension on Windows
Step-by-step instructions for adding the Chilkat extension to a Windows PHP installation, plus the checks that prevent the most common “unable to load” errors.
- PHP version — e.g. the 8.5 extension for PHP 8.5.
- Architecture — x64 for 64-bit PHP, win32 for 32-bit PHP.
- Thread safety — the NTS (non-thread-safe) download for non-thread-safe PHP, or the regular (thread-safe) download for thread-safe PHP.
-
Download
Get the build for your PHP from the Chilkat Windows PHP Downloads.
-
What's in the download
Unzip the
.zip(with 7-Zip or Windows Explorer). It contains:chilkat-php-<version>-<build>/ ├─ chilkat.php PHP class definitions (include this) ├─ chilkat.dll the Chilkat extension ├─ phpinfo.php prints your PHP configuration ├─ showExtDir.php prints the extension directory ├─ test.php verifies the install ├─ license.pdf ├─ pcre2-license.pdf └─ quickjs-license.pdf
Two files, two roles:chilkat.dllis the native extension that PHP loads (Steps 4–5).chilkat.phpdefines the Chilkat classes (CkGlobal,CkHttp, …) and isincluded by your own scripts — keep it where your script can find it (your project directory or a path oninclude_path). -
Check your PHP version, architecture, and thread safety
From a command prompt:
php -v php -i | findstr /C:"Thread Safety" /C:"Architecture" /C:"Loaded Configuration File" /C:"extension_dir"
Or run
phpinfo.phpthrough your web server to see the values that apply to web requests (these can differ from the command-line PHP):- Thread Safety → disabled = use the NTS download; enabled = use the regular download.
- Architecture →
x64= x64 download;x86= win32 download. - Loaded Configuration File → the
php.iniyou'll edit in Step 6. - extension_dir → where
chilkat.dllgoes in Step 4.
-
Copy chilkat.dll to the extension directory
Copy chilkat.dll into PHP's extension directory. To find it, run:
php showExtDir.php
(
showExtDir.phpsimply printsini_get("extension_dir").)chilkat.phpis not an extension — it's the class file your scriptsinclude(Step 7), so keep it with your project or on theinclude_path. -
Enable the extension in php.ini
Open the
php.inireported as the Loaded Configuration File in Step 3, find the Dynamic Extensions section, and add:extension=chilkat.dll
If you run PHP under Apache, IIS, or PHP-FPM, restart the web server after editing
php.iniso the change takes effect. (The command-line PHP picks it up immediately.) -
Verify with test.php
Run the included
test.php, which unlocks Chilkat in trial mode and performs an AES encrypt/decrypt:php test.php
Successful output looks like:
Unlocked in trial mode. 4846f83aa211e239aa62a21f527f089ee9ddbead30ee15d4e79b607a621b97bedb9b6f00a9b21f1b43a50b4c1be0edf2 The quick brown fox jumps over the lazy dog. -
Use Chilkat in your scripts
Include
chilkat.phpand unlock once at the start of your program (any string starts the 30-day trial; use your license code after purchase):<?php include("chilkat.php"); $glob = new CkGlobal(); $glob->UnlockBundle("Anything for 30-day trial"); // ... use any Chilkat class, e.g. new CkHttp(), new CkJsonObject(), ... ?>
Common errors
“Unable to load dynamic library 'chilkat.dll'”
Almost always a mismatch between the DLL and your PHP. Re-check Step 3 and confirm all three match: PHP version, architecture (x64 vs win32), and thread safety (NTS vs thread-safe). A wrong architecture often reports “%1 is not a valid Win32 application”.
“Class 'CkGlobal' not found”
Your script didn't include the class definitions. Add
include("chilkat.php"); and make sure chilkat.php is reachable
from your script (same directory or on the include_path).
Works on the command line but not in the web server (or vice-versa)
CLI and the web SAPI can use different php.ini files. Run
phpinfo() in the same context that's failing and use the Loaded
Configuration File value to be sure you edited the right one — then restart the
web server.
Extension still not loaded
Confirm chilkat.dll is actually in the extension_dir from
Step 3, that the extension=chilkat.dll line isn't commented out, and
(for a web server) that you restarted it.