How to Install ionCube Loader in CentOS 7


Step 1: Install Apache or Nginx Web Server with PHP

1. If you already have a running web server Apache or Nginx with PHP installed on your system, you can jump to the Step 2, otherwise use the following yum command to install them.

-------------------- Install Apache with PHP --------------------
# yum install httpd php php-cli	php-mysql

-------------------- Install Nginx with PHP -------------------- 
# yum install nginx php php-fpm php-cli	php-mysql

2. After installing Apache or Nginx with PHP on your system, start the web server and make sure to enable it to auto start at system boot time using following commands.

-------------------- Start Apache Web Server --------------------
# systemctl start httpd
# systemctl enable httpd

-------------------- Start Nginx + PHP-FPM Server --------------------
# systemctl start nginx
# systemctl enable nginx
# systemctl start php-fpm
# systemctl enable php-fpm

Step 2: Download IonCube Loader

3. Go to the inocube’s website and download the installation files, but before that first you need to check whether your system is running on 64-bit or 32-bit architecture using the following command.

# uname -a

Linux 4.15.0-1.el7.elrepo.x86_64 #1 SMP Sun Jan 28 20:45:20 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

As per your Linux system architecture type download the ioncube loader files into /tmp directory using following wget command.

-------------------- For 64-bit System --------------------
# cd /tmp
# wget

-------------------- For 32-bit System --------------------
# cd /tmp
# wget

4. Then unzip the downloaded file using the tar command and move into the decompressed folder. Then run the ls command to list the numerous ioncube loader files for different PHP versions.

# tar -xvf ioncube_loaders_lin_x86*
# cd ioncube/
$ ls -l

Step 3: Install ionCube Loader for PHP

5. There will be different ioncube loader files for various PHP versions, you need to select the right ioncube loader for your installed PHP version on your server. To know the php version installed on your server, run the command.

php -v

6. Next, find the location of the extension directory for PHP version 5.4, it is where the ioncube loader file will be installed. From the output of this command, the directory is /usr/lib64/php/modules.

# php -i | grep extension_dir

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

7. Next we need to copy ioncube loader for our PHP 5.4 version to the extension directory (/usr/lib64/php/modules).

# cp /tmp/ioncube/ /usr/lib64/php/modules

Step 4: Configure ionCube Loader for PHP

8. Now we need to configure ioncube loader to work with PHP, in the php.ini file.

# vim /etc/php.ini
//edit file php.ini, add below line
zend_extension = /usr/lib64/php/modules/

Then save and exit the file , Restart Apache or Nginx webserver

-------------------- Start Apache Web Server --------------------
# systemctl restart httpd

-------------------- Start Nginx + PHP-FPM Server --------------------
# systemctl restart nginx
# systemctl restart php-fpm

Step 5: Test ionCube Loader

# php -v

Leave a Reply

Notify of