Are you looking for steps to install ionCube on Ubuntu 16.04? Then take a peek at this blog.
Here at Bobcares, we have seen several such Ubuntu related installations as part of our Server Management Services for web hosts and online service providers.
Today we’ll see how to install ionCube on Ubuntu.
A few facts about ionCube
ionCube is a PHP module extension that handles the reading and execution of encoded files at runtime. Also, it is used as the encryption and decryption utility for PHP applications using which we can keep our data safe.
It also helps in speeding up webpages. Moreover, it restricts the unauthorized execution of PHP applications.
How we install ionCube on Ubuntu 16.04
Now let’s see how our Support Engineers install ionCube.
1. Choose the Right ionCube Version
As a first step, we need to choose the ionCube version that matches with the PHP version. So check the PHP version running on the server and if it is a 32-bit or 64-bit.
If you are having a 64 bit Ubuntu then you are running 64 bit PHP version on the server. In order to check that we create a info.php file using the command.
$ sudo nano /var/www/html/info.php
Then add the below code into it.
<?php
phpinfo();
Save the file and access the below link in the web browser. Make sure to replace the your_server_ip with your IP address or the domain name.
http://your_server_ip/info.php
Check the System line. If it ends with x86_64, you’re running 64-bit PHP. But if it ends with i686, it’s 32-bit.
2. Setting up ionCube
Access the official ionCube download page and download the appropriate link based on your OS. We are now installing the 64 bit Linux version. So, first, we copy the tar.gz link on the site and download the file.
$ wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
Then extract the archive.
$ tar xvfz ioncube_loaders_lin_x86-64.tar.gz
This will create a directory named ionCube which contains various files for various PHP versions. We need to choose the right folder for the PHP version. Here we need the file PHP version 7.0, which is ioncube_loader_lin_7.0.so.
Now we will copy this file to the extensions folder. In order to find out the path of the extensions folder, check the http://your_server_ip/info.php page again and search for extension_dir.
In our example, the path is /usr/lib/php/20151012. So we need to copy the file there.
$ sudo cp ioncube/ioncube_loader_lin_7.0.so /usr/lib/php/20151012/
In order to load the extensions for the PHP, we need to add it to the PHP configuration. We can do this in the main php.ini file. But it would be cleaner if we create a separate file for it.
To find where to create the custom configuration file, look at http://your_server_ip/info.php again and search for Scan this dir for additional .ini files.
Now we found the path to be /etc/php/7.0/apache2/conf.d. So we will create a file named 00-ioncube.ini within it.
$ sudo nano /etc/php/7.0/apache2/conf.d/00-ioncube.ini
Now we add the below loading directive, save, and close the file.
zend_extension = "/usr/lib/php/20151012/ioncube_loader_lin_7.0.so"
Then we need to restart the web server so that the above changes takes effect.
If you are using Apache, run:
sudo systemctl restart apache2.service
If you are using Nginx, run:
sudo systemctl restart nginx
Restart php-fpm as well, if you are using it.
$ sudo systemctl restart php7.0-fpm.service
3. Verify the ionCube Installation on Ubuntu
Finally, its time to verify the installation. For that, access the http://your_server_ip/info.php page and refresh it and search for “ionCube” keyword. You must now see with the ionCube PHP Loader (enabled).
This confirms that the PHP ionCube extension is loaded on the server.
However, when considering the security it is better to remove the info.php file as it allows the attackers to see the information of the server. So run the below command to remove the file.
$ sudo rm /var/www/html/info.php
Also, you can remove the xtra downloaded ionCube files which are no longer necessary.
$ sudo rm ioncube_loaders_lin_x86-64.tar.gz
$ sudo rm -rf ioncube_loaders_lin_x86-64
Finally, now the ionCube is fully set.
[Need any further assistance with Ubuntu queries? – We are here to help you.]
Conclusion
In today’s writeup, we saw how our Support Engineers install ionCube on Ubuntu.
0 Comments