Share your love
Install ionCube PHP Loader on Rocky Linux 9: Protect Scripts

This guide will show you how to Install ionCube PHP Loader on Rocky Linux 9. As a simple explanation, ionCube Loader is a module for PHP that is used to load PHP-encrypted files. This option will increase your security to protect your scripts.
In this guide on the Orcacore website, you will learn to activate your ionCube PHP loader step by step on Rocky Linux 9.
Note: If you are looking for installation steps of the PHP ionCube loader on another OS, you can visit the following guides:
Set up PHP ionCube Loader on Debian 11
Install PHP ionCube Loader on Centos 7
Install ionCube Loader on Ubuntu 22.04
Table of Contents
How To Install ionCube PHP Loader on Rocky Linux 9?
To complete this guide, you must access your server as a root user. For this purpose, you can visit our guide on Initial Server Setup with Rocky Linux 9.
Now follow the steps below to complete this guide on PHP ionCube loader setup.
Step 1 – Install PHP 8.1 on Rocky Linux 9
Rocky Linux 9 ships with the default PHP 8.0, but to install the ionCube loader you must have PHP 8.1 installed on your server. To do this, follow the steps below:
First, you must run the system update:
sudo dnf update -y
Then, install the Epel repository on your server with the following command:
sudo dnf install epel-release -y
Now use the command below to add the Remi repository:
sudo dnf install dnf-utils https://rpms.remirepo.net/enterprise/remi-release-9.rpm
Again run the system update:
sudo dnf update -y
Here you need to remove the PHP and PHP-FPM previous versions if you have them installed on your server. To do this, run the following command:
sudo dnf remove php php-fpm -y
Then remove the rest of the package extensions with the command below:
sudo dnf remove php* -y
To reset the PHP module list on Rocky Linux 9, you can use the following command:
sudo dnf module list reset php -y

Now you need to enable PHP 8.1 on Rocky Linux 9 with the command below:
sudo dnf module enable php:remi-8.1
At this point, you have added the Remi PHP repository and enabled PHP 8.1 to be the default version on your system, you can install PHP 8.1 and httpd service with the following command:
sudo dnf install php httpd -y
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
Step 2 – Install ionCube Loader on Rocky Linux 9
At this point you have PHP 8.1 installed on your Rocky Linux 9, proceed to the following steps to set up your PHP ionCube loader.
Download ionCube PHP 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
Then, use the following command to list the content of the PHP ionCube loader directory on Rocky Linux 9:
ls ioncube
In your output, you will see:
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
How To Activate 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 on Rocky Linux 9:
cp ioncube/ioncube_loader_lin_8.1.so /usr/lib64/php/modules/
Then, you need to enable the PHP 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 Activation
At this point, you can verify your PHP ionCube loader module by checking the PHP version:
php -v
If everything is fine, 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 Rocky Linux 9 server.
Conclusion
At this point, you have learned to protect your PHP scripts by installing the ionCube loader on Rocky Linux 9. As you saw, you should just install PHP 8.1 and follow the simple steps to activate your ionCube loader.
Hope you enjoy it. You may also like these articles:
Install OnlyOffice on Rocky Linux 8
Install Ruby on Rails on AlmaLinux 9
FAQs
Where is the Default PHP Configuration File?
The default PHP configuration file is called the php.ini file. If you plan to make configuration changes to your PHP file and you can find your php.ini file, You can visit the following guide to see how to find your php.ini file: Find php.ini File Location on Linux
How To Install PHP Extensions?
If you would like to install the most commonly used extensions for PHP 8.1, you can use the following command on your server:sudo dnf install php-cli php-fpm php-curl php-mysqlnd php-gd php-opcache php-zip php-intl php-common php-bcmath php-imap php-imagick php-xmlrpc php-json php-readline php-memcached php-redis php-mbstring php-apcu php-xml php-dom php-redis php-memcached php-memcache
Also, those interested in the development branch can use the following command:sudo dnf install php-devel -y