How to Install the Chilkat PHP Extension on MAC OS X
The download contains the following files:
2. Decompress and Extract to any Directory
gzip -dc chilkatPhp-9.4.1-x86_64-linux.tar.gz | tar -xof -
3. Copy chilkat_9_5_0.so to the PHP extensions directory.
To find the path of the PHP extensions directory, run the showExtDir.php script:
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/lib/php/extensions
sudo mkdir /usr/lib/php5/20131226
Now that the extensions directory exists, copy the chilkat shared library to it:
sudo cp chilkat_9_5_0.so /usr/lib/php5/20131226
4. Edit php.ini.default to Automatically Load the Chilkat Extension
Find the location of the php.ini file with this command (run from the directory where Chilkat PHP was unpacked)
php phpinfo.php | grep php.ini
The path is likely to be /etc.
Another way of finding the location of php.ini is with this command:
You will need to be root to edit the php.ini.
Open the php.ini and locate the "Dynamic Extensions" section.
Add the following line:
If php.ini does not exist, but php.ini.default exists, then copy php.ini.default to php.ini, and then edit php.ini:
sudo cp /etc/php.ini.default /etc/php.ini
sudo chmod o+w /etc/php.ini
sudo vi /etc/php.ini
Important: It can often be difficult to find the location of the php.ini. Once found, it is often difficult to actually update the file
because of permissions and security. I've found that even as root and with file permissions set correctly, the "vi" editor was still required to edit and save the file.
4. Run test.php to Verify
Run the test.php script to verify that the Chilkat extension is properly installed:
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.
5. Use Chilkat in your PHP Scripts
To use Chilkat in your PHP scripts, include "chilkat_9_5_0.php" like this: