How to configure ZendGuard in CentOS/RHEL
Running Zend Guard on your PHP scripts will help encode your scripts to prevent reverse engineering and unauthorized edits to your code, it will likewise shield your code from unapproved utilization, and you can run Zend Guard encoded scripts through Zend Optimizer (with PHP 5.2 and more established) to help upgrade the execution of your PHP applications too.
Zend Guard expands programming productivity by:
Step 1: First we need to check the version of php. Use following command to check the version
php -v
Step 2: Now you will download Zend Guard package according to PHP installed on server.
You can also download ZendGuard from Zend website.
# cd /opt For 64-bit (PHP 5.4): # wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz For 32-bit (PHP 5.4): #wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz For 64-bit (PHP 5.3): # wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz For 32-bit (PHP 5.3): # wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
Step 3: Now extract the archive using tar command and access the ZendGuard folder:
# tar xzvf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz # cd ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
Step 4: After accessing the ZendGuard folder copy ZendGuardLoader.so file to modules directory:
For 32-bit: /usr/lib/php/modules For 64-bit: /usr/lib64/php/modules # cp /opt/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so /usr/lib64/php/modules
Step 5: Now add following lines inside that php.ini file or you can also create new file ZendGuard.ini inside /etc/php.d directory:
# vim /etc/php.d/ZendGuard.ini For 32-bit: ; Enable Zend Guard extension zend_extension=/usr/lib/php/modules/ZendGuardLoader.so zend_loader.enable=1 For 64-bit: ; Enable Zend Guard extension zend_extension=/usr/lib64/php/modules/ZendGuardLoader.so zend_loader.enable=1
Step 6: Now you can restart Apache service:
# service httpd restart
Step 7: Check using the following command that ZendGuard extension is configured or not
# php -v