{"id":188,"date":"2022-12-01T17:43:56","date_gmt":"2022-12-01T15:43:56","guid":{"rendered":"https:\/\/cimalink.eu\/blog\/?p=188"},"modified":"2022-12-01T17:43:56","modified_gmt":"2022-12-01T15:43:56","slug":"how-to-install-ioncube-loader-in-debian-and-ubuntu","status":"publish","type":"post","link":"https:\/\/cimalink.eu\/blog\/how-to-install-ioncube-loader-in-debian-and-ubuntu\/","title":{"rendered":"How to Install ionCube Loader in Debian and Ubuntu"},"content":{"rendered":"\n<p><strong>ionCube<\/strong>&nbsp;loader is a PHP extension (module) that enables PHP to load files protected and encoded using&nbsp;<strong>ionCube Encoder<\/strong>&nbsp;software, which is mostly used in commercial software applications to protect their source code and prevent it from being visible and detectable.<\/p>\n\n\n\n<p><strong>Read Also<\/strong>:&nbsp;<a href=\"https:\/\/www.tecmint.com\/install-ioncube-loader-in-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install ionCube Loader in CentOS 7<\/a><\/p>\n\n\n\n<p>In this article, we will explain how to install and configure&nbsp;<strong>ionCube Loader<\/strong>&nbsp;with&nbsp;<strong>PHP<\/strong>&nbsp;in&nbsp;<strong>Debian<\/strong>&nbsp;and&nbsp;<strong>Ubuntu<\/strong>&nbsp;distributions.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Prerequisites:<\/h4>\n\n\n\n<p>A&nbsp;<strong>Ubuntu<\/strong>&nbsp;or&nbsp;<strong>Debian<\/strong>&nbsp;server running with a web server (<a href=\"https:\/\/www.tecmint.com\/install-lamp-apache-php-7-and-mariadb-10-on-ubuntu-16-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Apache<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/www.tecmint.com\/install-nginx-mysql-php-lemp-in-ubuntu-16-10-ubuntu-16-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a>) along with a&nbsp;<strong>PHP<\/strong>&nbsp;installed. If you don\u2019t have a web server and PHP on your system, you can install them using&nbsp;<a href=\"https:\/\/www.tecmint.com\/apt-advanced-package-command-examples-in-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">apt package manager<\/a>&nbsp;as shown.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install Apache or Nginx Web Server with PHP<\/h3>\n\n\n\n<p><strong>1.<\/strong>&nbsp;If you already have a running web server&nbsp;<strong>Apache<\/strong>&nbsp;or&nbsp;<strong>Nginx<\/strong>&nbsp;with&nbsp;<strong>PHP<\/strong>&nbsp;installed on your system, you can jump to&nbsp;<strong>Step 2<\/strong>, otherwise use the following&nbsp;<a href=\"https:\/\/www.tecmint.com\/apt-advanced-package-command-examples-in-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">apt command<\/a>&nbsp;to install them.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>-------------------- Install Apache with PHP --------------------<\/strong>\n$ sudo apt install apache2 php7.0 php7.0-fpm php7.0-cli \n\n<strong>-------------------- Install Nginx with PHP --------------------<\/strong> \n$ sudo apt install nginx php7.0 php7.0-fpm php7.0-cli\n<\/pre>\n\n\n\n<p><strong>2.<\/strong>&nbsp;Once you\u2019ve installed&nbsp;<strong>Apache<\/strong>&nbsp;or&nbsp;<strong>Nginx<\/strong>&nbsp;with&nbsp;<strong>PHP<\/strong>&nbsp;on your system, you can start the webserver and activate it to auto-start at system boot using following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>-------------------- Start Apache Web Server --------------------<\/strong>\n$ sudo systemctl start apache2\n$ sudo systemctl enable apache2\n\n<strong>-------------------- Start Nginx + PHP-FPM Server --------------------<\/strong>\n$ sudo systemctl start nginx\n$ sudo systemctl enable nginx\n$ sudo systemctl start php7.0-fpm\n$ sudo systemctl enable php7.0-fpm\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Download IonCube Loader<\/h3>\n\n\n\n<p><strong>3.<\/strong>&nbsp;Go to the&nbsp;<a href=\"https:\/\/www.ioncube.com\/loaders.php\" target=\"_blank\" rel=\"noreferrer noopener\">inocube\u2019s website<\/a>&nbsp;and download the installation files, but before that, you need to check whether your&nbsp;<a href=\"https:\/\/www.tecmint.com\/find-linux-kernel-version-distribution-name-version-number\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux distribution is running on 64-bit or 32-bit architecture<\/a>&nbsp;using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>$ uname -r<\/strong>\n\nLinux TecMint 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 <strong>x86_64 x86_64 x86_64<\/strong> GNU\/Linux\n<\/pre>\n\n\n\n<p>The above output clearly shows that the system is running on&nbsp;<strong>64-bit<\/strong>&nbsp;architecture.<\/p>\n\n\n\n<p>As per your Linux distribution architecture, download ioncube loader files to&nbsp;<strong>\/tmp<\/strong>&nbsp;directory using following&nbsp;<a href=\"https:\/\/www.tecmint.com\/10-wget-command-examples-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">wget command<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>-------------------- For 64-bit System --------------------<\/strong>\n$ cd \/tmp\n$ wget https:\/\/downloads.ioncube.com\/loader_downloads\/ioncube_loaders_lin_x86-64.tar.gz\n\n<strong>-------------------- For 32-bit System --------------------<\/strong>\n$ cd \/tmp\n$ wget https:\/\/downloads.ioncube.com\/loader_downloads\/ioncube_loaders_lin_x86.tar.gz\n<\/pre>\n\n\n\n<p><strong>4.<\/strong>&nbsp;Then uncompress the downloaded file using the&nbsp;<a href=\"https:\/\/www.tecmint.com\/18-tar-command-examples-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">tar command<\/a>&nbsp;and switch into the unzipped folder. Then run the&nbsp;<a href=\"https:\/\/www.tecmint.com\/tag\/linux-ls-command\/\" target=\"_blank\" rel=\"noreferrer noopener\">ls command<\/a>&nbsp;to list the various ioncube loader files for different PHP versions.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ tar -zxvf ioncube_loaders_lin_x86*\n$ cd ioncube\/\n$ ls -l\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_29191\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Ioncube-Loader-Files.png\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Ioncube-Loader-Files.png\" alt=\"Ioncube Loader Files\" class=\"wp-image-29191\"\/><\/a><figcaption class=\"wp-element-caption\">Ioncube Loader Files<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Install ionCube Loader for PHP<\/h3>\n\n\n\n<p><strong>5.<\/strong>&nbsp;In the above screenshot, you will see various ioncube loader files for different PHP versions, you need to select the right ioncube loader for your installed PHP version on your server. To know the currently installed PHP version on your server, run the command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ php -v\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\" id=\"attachment_29206\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-PHP-Version-in-Ubuntu.png\"><img decoding=\"async\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-PHP-Version-in-Ubuntu.png\" alt=\"Check PHP Version in Ubuntu\" class=\"wp-image-29206\"\/><\/a><figcaption class=\"wp-element-caption\">Check PHP Version in Ubuntu<\/figcaption><\/figure>\n\n\n\n<p>The above screenshot clearly tells that the system is using&nbsp;<strong>PHP 7.0.25<\/strong>&nbsp;version, in your case, it should be a different version.<\/p>\n\n\n\n<p><strong>6.<\/strong>&nbsp;Next, find the location of the extension directory for PHP version&nbsp;<strong>7.0.25<\/strong>, it is where the ioncube loader file will be installed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>$ php -i | grep extension_dir<\/strong>\n\nextension_dir =&gt; \/usr\/lib\/php\/20151012 =&gt; <strong>\/usr\/lib\/php\/20151012<\/strong>\n<\/pre>\n\n\n\n<p><strong>7.<\/strong>&nbsp;Next we need to copy ioncube loader for our&nbsp;<strong>PHP 7.0.25<\/strong>&nbsp;version to the extension directory (<strong>\/usr\/lib\/php\/20151012<\/strong>).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo cp \/tmp\/ioncube\/ioncube_loader_lin_7.0.so \/usr\/lib\/php\/20151012\n<\/pre>\n\n\n\n<p><strong>Note<\/strong>: Make sure to replace the PHP version and extension directory in the above command according to your system configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Configure ionCube Loader for PHP<\/h3>\n\n\n\n<p><strong>8.<\/strong>&nbsp;Now we need to configure ioncube loader to work with PHP, in the&nbsp;<code>php.ini<\/code>&nbsp;file.&nbsp;<strong>Debian<\/strong>&nbsp;and&nbsp;<strong>Ubuntu<\/strong>&nbsp;use different&nbsp;<strong>php.ini<\/strong>&nbsp;files for&nbsp;<strong>PHP CLI<\/strong>&nbsp;and&nbsp;<strong>PHP-FPM<\/strong>&nbsp;as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo vi \/etc\/php\/7.0\/cli\/php.ini \t\t#for PHP CLI \n$ sudo vi \/etc\/php\/7.0\/fpm\/php.ini\t\t#for PHP-FPM &amp; Nginx\n$ sudo vi \/etc\/php\/7.0\/apache2\/php.ini\t        #for Apache2\t\n<\/pre>\n\n\n\n<p>Then add below line as the first line in the respective&nbsp;<code>php.ini<\/code>&nbsp;files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">zend_extension = \/usr\/lib\/php\/20151012\/ioncube_loader_lin_7.0.so\n<\/pre>\n\n\n\n<p><strong>Note<\/strong>: Make sure to replace the extension directory location and PHP version in the above command according to your system configuration.<\/p>\n\n\n\n<p><strong>9.<\/strong>&nbsp;Then save and exit the file. Now we need to restart the&nbsp;<strong>Apache<\/strong>&nbsp;or&nbsp;<strong>Nginx<\/strong>&nbsp;web server for the ioncube loaders to come into effect.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>-------------------- Start Apache Web Server --------------------<\/strong>\n$ sudo systemctl restart apache2\n\n<strong>-------------------- Start Nginx + PHP-FPM Server --------------------<\/strong>\n$ sudo systemctl restart nginx\n$ sudo systemctl restart php-fpm\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Test ionCube Loader<\/h3>\n\n\n\n<p><strong>10.<\/strong>&nbsp;Now it\u2019s time to verify that the ionCube loader is properly installed and configured on your server by checking the PHP version one more time. You should be able to see a message indicating that PHP is installed and configured with the ioncube loader extension (status should be enabled), as shown in the output below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>$ php -v<\/strong>\n\nPHP 7.0.25-0ubuntu0.16.04.1 (cli) ( NTS )\nCopyright (c) 1997-2017 The PHP Group\nZend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies\n    <strong>with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.0, Copyright (c) 2002-2018, by ionCube Ltd.<\/strong>\n    with Zend OPcache v7.0.25-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies\n<\/pre>\n\n\n\n<p>That\u2019s It! In order to secure PHP files, you need to have IonCube loader installed and configured with your installed PHP version, as shown above. We hope that everything worked fine without any issues, otherwise, use the feedback form below to send us your queries.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ionCube&nbsp;loader is a PHP extension (module) that enables PHP to load files protected and encoded using&nbsp;ionCube Encoder&nbsp;software, which is mostly used in commercial software applications to protect their source code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[16,84,15],"class_list":["post-188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-debian","tag-ioncube-loader","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":1,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/188\/revisions\/189"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}