How to Install Zend and Ioncube Loader on Vestacp (CentOS)

Saturday, January 9th 2016. | how to

#howto ,#tutorial #VPS – How to Install Zend and Ioncube Loader on Vestacp (CentOS) – This tutorial explains step by step guide (with pics) about How to Install Zend and Ioncube Loader on Vestacp (CentOS)

Being free web hosting control panel, Vestacp has managed to become popular panel with active development. Installation process made easy plus a bunch of useful features included within like Nginx, PHP-fpm, complete LAMP stack, and so on. But there is still something missing, the Ioncube Loader. In this tutorial I will show you step by step guide how to install ionCube PHP loader which of course including how to install Zend Guard Loader which is needed by ionCube.

Short introduction

ionCube Loader is a PHP module needed for your server to read / decode any encoded and secured PHP scripts used by some apps. PHP can use the Loader with one line added to a PHP configuration file (php.ini). Well, as not all apps are using this technology so basically in common Vestacp install, ionCube loader is not necessary especially if you just want to host WordPress. But however some apps like ClientExect or any other PHP apps are using ionCube PHP encoder technology to protect PHP source code from easy observation, theft and change by compiling to bytecode.

Zend Guard Loader is previously knows as Zend Optimizer. The Zend Guard itself is the most widely accepted PHP encoding and obfuscation product to protect PHP application from unlicensed use and reverse engineering. This technology compiles and converts the plain-text PHP scripts into a platform-independent binary format known as a Zend Intermediate Code file. These encoded binary files can then be distributed instead of the plain text PHP protecting developers’ hard programming efforts. While Zend Guard Loader is shortly a tool to read and decode the encoded PHP scripts. Zend Guard Loader is a free runtime application that enables PHP to run the scripts encoded by Zend Guard. It can be used freely by anyone looking to run encoded applications.

Also, in order for ionCube Loader to work, the Zend Guard Loader is necessary to install. So in the first part of this guide I’ll start with the Zend.

Prerequisites

What you may need:

  1. A SSH client like Bitvise or Putty and basic knowledge about how to use it.
  2. Basic knowledge about common Unix command to SSH to your server.
  3. A server or VPS with at least 512MB of RAM (1GB or more is recommended).
  4. Make sure your Vestacp server is installed and running on CentOS server.
    Read: How to install Vestacp on CentOS
  5. About 30 minutes of your time
  6. a cup of coffee or tea.

Confused on choosing which VPS provider to install VestaCP? Read my recommended VPS providers or top low end cloud server providers. Quick recommendation: Digital Ocean, Atlantic.net or Ramnode.

In this guide I’m using a 512MB RAM Cloud VPS from Digital Ocean running CentOS 7.1 x64.

Install Zend Guard Loader

Step 0 – Install VestaCP on your server

Step 1 – Login to your server via Putty (or any SSH client) as root or as user with root privilege (sudo).

Step 2 – Check your PHP version. This is necessary and important since Zend has made Guard Loader to every specific PHP version.

php -v

check php version vesta

Until this article is posted, the last time I checked VestaCP is using PHP 5.4.x on its build for CentOS while its Ubuntu version is PHP 5.6.x

Step 3 – Next, you need to download Zend Guard Loader package appropiate to the version of PHP you have and type of operating system your server is running (it is Linux but whether it is 32-bit or 64-bit). Go ahead grab the package from:

http://www.zend.com/en/products/loader/downloads#Linux

zend loader download page

Because it my case I need the one for PHP 5.4, then I need to scroll down the page a bit and click the Download Older Versions link.

You may also need to login or register for an account first. It’s free.

Now all you need to do is to grab the download url. You can achieve that by copying the URL once the Download Dialog box appears.

or, you can use these shortcut if you don’t mind using current latest version (do visit Zend website to check newer version – if available):

Zend Guard Loader for PHP 5.4 – 32 bit :

http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz

Zend Guard Loader for PHP 5.4 – 64 bit :

http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz

Since I’m using VestaCP on CentOS 7.1 which is 64-bit, so I picked the last one.

Step 4 – Use wget to download it into your server:

wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz

download zend loader package

Step 5 – Once the package has been downloaded, extract the package using command below:

tar xzvf name-of-package-file.tar.gz

for example in my case it is:

tar xzvf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz

Step 6 – Now enter the the new folder extracted and find the ZendGuardLoader.so file. See example below (use cd command):

cd ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64

extract zend guard loader package

then copy the ZendGuardLoader.so file to following location :

32-bit server: /usr/lib/php/modules

64-bit server: /usr/lib64/php/modules

example :

cp ZendGuardLoader.so /usr/lib64/php/modules

copy zend guard modules

Step 7 – Now create ZendGuard.ini file inside /etc/php.d directory (use your favorite text editor like nano) :

nano /etc/php.d/ZendGuard.ini

Step 8 – Next, copy paste following codes to that file in nano text editor:

for 32-bit server :

; Enable Zend Guard extension
zend_extension=/usr/lib/php/modules/ZendGuardLoader.so
zend_loader.enable=1

for 64-bit server :

; Enable Zend Guard extension
zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so
zend_loader.enable=1

zend guard ini file edit

Do not forget to Save and Exit the editor which in Nano it is Control+O then Control+X.

Step 9 – Also, restart Apache web server to make sure the Zend Loader module is loaded:

service httpd restart

Step 10 – Drink your coffee or tea you’ve prepared.

restart apache zend install

Install ionCube Loader

Step 1 – Again, login to your server via Putty.

Step 2 – Go to your site’s public folder (root directory of your site) which in Vestacp it is usually at :

/home/username/web/domain.tld/public_html

replace username with your vestacp username but it is preferable as admin, then replace domain.tld with your own domain name but it is recommended to use your hostname. Example :

cd /home/admin/web/vesta.servermom.org/public_html

Step 3 – Use wget again to download ionCube Loader package into your server. You can check download links of its latest version at :

https://www.ioncube.com/loaders.php

ioncube loaders download link

use wget to download it,..

For CentOS 32-bit use:

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

For CentOS 64-bit use :

wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Step 4 – Extract the package once it’s downloaded :

CentOS 32-bit :

tar xvfz ioncube_loaders_lin_x86.tar.gz

CentOS 64-bit :

tar xvfz ioncube_loaders_lin_x86-64.tar.gz

download ioncube loader vestacp

Step 5 – Open up your favorite web browser (e.g: Mozilla Firefox, Chrome, etc) and navigate to thsi url :

http://domain.tld/ioncube/loader-wizard.php

example:

http://vesta.servermom.org/ioncube/loader-wizard.php

2016-01-09_212811

Step 6 – From there simply read the instruction and the wizard will tell you which Loader version is suitable for your PHP version. In this case you choose whether Dedicated / VPS or Local Install.

ioncube loader wizard

Step 7 – As instructed, back to your server and copy the loader .so file to:

32-bit server: /usr/lib/php/modules

64-bit server: /usr/lib64/php/modules

example:

cp ioncube_loader_lin_5.4.so /usr/lib64/php/modules

Step 8 – Now go back to your web browser opening loader-wizard.php page and download the ioncube.ini file which is usually named with numbers prefix like 00-ioncube.ini :

open ioncube ini file

Downloaded already? Now open it in Notepad and copy the text inside it.

copy ioncube ini file

Step 9 – Create new .ini file inside /etc/php.d directory

nano /etc/php.d/00-ioncube.ini

then paste the text you copied earlier there:

paste ioncube ini module text

Save the file and exit nano editor (Control+O the Control+X).

Now go to that location and list all files inside that directory then make sure the 00-ioncube.ini file appears before all other modules most importantly appears first before ZendGuard.ini.

cd /etc/php.d
ls

ioncube ini location

Step 10 – Do not forget to restart Apache web server again so the new module can be loaded:

service httpd restart

Step 11 – Confirm that ionCube Loader has been installed successfully by simply issuing php -v command:

zend ioncube loader installed

It will show you something like this :

PHP 5.4.45 (cli) (built: Jan 6 2016 16:46:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
   with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (uncofigured) v5.0.19, Copyright (c) 2002 - 2015, by ionCube Ltd.
   with Zend Guard Loader v3.3, Copyright (c) 1998 - 2013, by Zend Technologies

or you can also create info.php file as usual then open it in your browser and you’ll see something like this:

php info page ioncube loader

That’s it. Now you have fully working Zend and ionCube Loader installed on your VPS with VestaCP control panel. Now all websites / domains hosted in that server will be able to use both feature.

Still got confused about following the steps above? I recorded all those steps above in a video you can watch it. I hope by watching the video you’ll get more detailed information which you can’t get from the steps above.

2016-01-09_222106

Download the video and donate $1.5 for me to buy a JCO donut.

Thanks

This post How to Install Zend and Ioncube Loader on Vestacp (CentOS) is part of ServerMom.

Source link