Installing PHPThemis #
PHPThemis is available as a system package for Linux. Usually you want to install the stable package to benefit from automatic dependency management and security updates. However, you can also build and install the latest PHPThemis from the source code.
Installing stable version on Linux #
The easiest way to install PHPThemis on Linux is to use package repositories for your system. We build packages for a multitude of Linux distributions.
Add Cossack Labs package repositories to your system.
Install PHPThemis package.
For Debian, Ubuntu:
sudo apt install libphpthemis-php7.0
For CentOS, RHEL:
sudo yum install libphpthemis-php7.0
libphpthemis-php7.0package is intended for PHP 7.0, 7.1, 7.2.
For PHP 5.6 you need to install
Once PHPThemis is installed, you can try out code examples.
Building latest version from source #
If the stable package version does not suit your needs, you can manually build and install the latest version of Themis from source code.
Build and install Themis Core library into your system.
Install PHPThemis extension:
This will build and install
phpthemis.soto the standard Zend extension directory.
Tell PHP to enable the new extension.
You need to add the following line to your
Verify that PHPThemis is correctly installed:
php --ri phpthemis