How to Install the Chilkat PHP Extension on Linux/Solaris

1. Download

Chilkat PHP Downloads

The download contains the following files:


2. Decompress and Extract to any Directory

gzip -dc chilkatPhp-9.5.0-x86_64-linux.tar.gz | tar -xof -

3. Copy to the PHP extensions directory.

To find the path of the PHP extensions directory, run the showExtDir.php script:

php showExtDir.php

(Alternatively, use the php5 command if necessary. Some systems may have both php and php5 each of which is a different version of PHP.

php5 showExtDir.php

A typical extension directory path is /usr/lib/php5/20131226

It may be that the extensions directory does not yet exist. If so, create the directories. Make sure to use your PHP extensions directory, which may or may not be the same as what is shown here:

sudo mkdir /usr/local/lib/php/extensions
sudo mkdir /usr/lib/php5/20131226

Now that the extensions directory exists, copy the chilkat shared library to it:

sudo cp /usr/lib/php5/20131226

4. Edit php.ini to Automatically Load the Chilkat Extension

* See the notes below for more explicit instructions for Mac OS X.

Locate the php.ini configuration file for your PHP installation. The location of the php.ini depends on where PHP was installed, and apparently there is no standard way to find it (even though PHP has an install base of millions and the need to edit php.ini is quite common). The phpinfo function lists the location of the php.ini, but in many cases it provides incorrect information.


If phpinfo provides incorrect information, php.ini might be found in one of the following directories:


If still not found, start a terminal and type this "find" command at the shell prompt:

find / -name php.ini 2> /dev/null

(It is likely you'll need to be root to edit the php.ini.)
Open the php.ini and locate the "Dynamic Extensions" section. Add the following line:

5. Run test.php to Verify

Run the test.php script to verify that the Chilkat extension is properly installed:

php test.php

The test.php script encrypts and decrypts a string. If successful, the output will look like this:

The quick brown fox jumps over the lazy dog.

6. Use Chilkat in your PHP Scripts

To use Chilkat in your PHP scripts, include "chilkat_9_5_0.php" like this:





7. Special Notes for Editing php.ini on Mac OS X

On Mac OS X, the php.ini is located in the /etc directory. If there is no php.ini file, then you need to make one from php.ini.default in the same location like so:

sudo cp /etc/php.ini.default /etc/php.ini
sudo chmod u+w  /etc/php.ini
Then add the line in your preferred text editor:
sudo nano /etc/php.ini
sudo vi /etc/php.ini