Install PHP ionCube Loader on Centos 7

This guide intends to teach you to Install PHP ionCube Loader on Centos 7.

If you need to encrypt PHP code in your application then a very popular choice is ionCube which has been designed to integrate well with both small and enterprise-level applications.

Typically, PHP source code is first passed through the ionCube encoder before an application has been distributed. This protects the code from being human-readable or from being edited.

However, by default, encrypted PHP source code cannot be executed directly on the server. It needs to be decrypted before the PHP engine can process it.

This is where the ionCube loader comes in.

Steps To Install PHP ionCube Loader on Centos 7

To complete this guide, you must log in to your server as a root user. To do this, you can follow our guide on Initial Server Setup with Centos 7.

Install PHP and Apache on Centos 7

First, you need to update your local package index with the following command:

yum update -y

Then, use the command below to install Apache:

yum install httpd -y

Now you must install PHP 8.1 on your server. To do this, you can visit this guide on Installing PHP 8.1 on Centos 7.

Verify your PHP installation by checking its version:

php --version
Output
PHP 8.1.18 (cli) (built: Apr 11 2023 16:47:45) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

Set up ionCube Loader on Centos 7

At this point, you can follow the steps below to install ionCube on your server.

Download ionCube Loader

Visit the ionCube Loader downloads page and get the latest version by using the following wget command:

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

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

tar xzf ioncube_loaders_lin_x86-64.tar.gz

List ionCube content directory

Then, use the following command to list the content of the ionCube directory on Centos 7:

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

Enable ionCube Loader in PHP

At this point, you need to find the location of the extension directory. To do this, you can use the following command:

php -i | grep extension_dir
Output
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

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

cp ioncube/ioncube_loader_lin_8.1.so /usr/lib64/php/modules/

Then, you need to enable the ionCube loader by editing the php.ini file. You can use your favorite text editor, here we use the vi editor:

vi /etc/php.ini

Add the following line at the end of the file:

zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_8.1.so

When you are done, save and close the file.

Finally, restart Apache to apply the changes:

systemctl restart httpd

Verify ionCube Loader PHP module on Centos 7

At this point, you can verify your ionCube loader PHP module by checking the PHP version:

php -v

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

Output
PHP 8.1.18 (cli) (built: Apr 11 2023 16:47:45) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with the ionCube PHP Loader v12.0.5, Copyright (c) 2002-2022, by ionCube Ltd.
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

Also, you can use the following command:

php -m
Output
...
[Zend Modules]
Zend OPcache
the ionCube PHP Loader

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

Conclusion

At this point, you have learned to Install PHP ionCube Loader on Centos 7.

Hope you enjoy it. For more articles, you can visit the orcacore website.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!