How to Install PHP ionCube Loader in CentOS 8

ionCube loader is a PHP extension that is used to decode PHP scripts encoded by the ionCube PHP Encoder package. It is very useful to protect the source code of PHP-based applications and prevent it from being visible, changed, and run on unlicensed computers. It is an encryption/decryption utility for PHP-based applications that will also speed up the page load time.

In this tutorial, we will show you how to enable the ionCube loader in PHP on CentOS 8.

Prerequisites

  • A server running CentOS 8.
  • A root password is configured on your server.

Install Apache and PHP

Before starting, you will need to install PHP and Apache on your system. You can install it by running the following command:

yum install httpd php php-common php-cli -y

Once all the packages are installed, check the version of the PHP with the following command:

php --version

You should get the following output:

PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Download ionCube Loader

First, download the latest version of ionCube Loader from its official website. You can download it with the following command:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Once the download is completed, extract the downloaded file with the following command:

tar xzf ioncube_loaders_lin_x86-64.tar.gz

Next, list the content of ioncube directory:

ls ioncube

You should see the following output:

ioncube_loader_lin_4.1.so     ioncube_loader_lin_5.0_ts.so  ioncube_loader_lin_5.4.so     ioncube_loader_lin_7.0_ts.so  LICENSE.txt
ioncube_loader_lin_4.2.so     ioncube_loader_lin_5.1.so     ioncube_loader_lin_5.4_ts.so  ioncube_loader_lin_7.1.so     loader-wizard.php
ioncube_loader_lin_4.3.so     ioncube_loader_lin_5.1_ts.so  ioncube_loader_lin_5.5.so     ioncube_loader_lin_7.1_ts.so  README.txt
ioncube_loader_lin_4.3_ts.so  ioncube_loader_lin_5.2.so     ioncube_loader_lin_5.5_ts.so  ioncube_loader_lin_7.2.so     USER-GUIDE.pdf
ioncube_loader_lin_4.4.so     ioncube_loader_lin_5.2_ts.so  ioncube_loader_lin_5.6.so     ioncube_loader_lin_7.2_ts.so  USER-GUIDE.txt
ioncube_loader_lin_4.4_ts.so  ioncube_loader_lin_5.3.so     ioncube_loader_lin_5.6_ts.so  ioncube_loader_lin_7.3.so
ioncube_loader_lin_5.0.so     ioncube_loader_lin_5.3_ts.so  ioncube_loader_lin_7.0.so     ioncube_loader_lin_7.3_ts.so

Enable ionCube Loader in PHP

Next, you will need to find the location of the extension directory. You can do it with the following command:

php -i | grep extension_dir

You should get the following output:

extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

Now, copy the ionCube loader module from the ioncube directory that matches your PHP version to the PHP extension directory:

cp ioncube/ioncube_loader_lin_7.2.so /usr/lib64/php/modules/

Next, you will need to enable it by editing php.ini file:

nano /etc/php.ini

Add the following line at the end of the file:

zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.2.so

Next, restart Apache service to apply the changes:

systemctl restart httpd

Verify ionCube Loader installation

Next, verify the ionCube Loader PHP module with the following command:

php -v

If everything is fine, you should get the following output:

PHP 7.2.11 (cli) (built: Oct  9 2018 15:09:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.3.9, Copyright (c) 2002-2019, by ionCube Ltd.

You can also verify it with the following command:

php -m

You should see the following output:

[PHP Modules] bz2 calendar Core ctype curl date exif fileinfo filter ftp gettext hash iconv ionCube Loader libxml openssl pcntl pcre Phar readline Reflection session sockets SPL standard tokenizer zlib [Zend Modules] the ionCube PHP Loader + ionCube24

The above output confirms that the PHP ionCube extension is loaded on your server.

Congratulations! ionCube PHP module is now installed and enabled on your server.

Share this page:

Suggested articles

0 Comment(s)

Add comment