Encode PHP by ionCube

1. Environment :
PHP 5.2.14
PHP-FPM 0.5.14

2. Encode with ionCube :
Download(purchase or try free trial) ionCube encoder from http://www.ioncube.com/
[codesyntax lang=”bash”]

$ cd /data/soft_misc/
$ tar xzf ioncube_encoder_evaluation.tar.gz
$ cd ioncube_encoder_evaluation
# encode the includes folder and ignore the configuration file : constants.php
$ ./ioncube_encoder5 --ignore "constants.php" -o /home/projects/abc/includes_ed /home/projects/abc/includes/
$ mv -f includes_ed/* includes/
$ rm -rf includes_ed

[/codesyntax]

3. Install ionCube Loaders (See http://www.ioncube.com/) :
[codesyntax lang=”bash”]

# download and unzip
$ cd /data/soft_misc/
$ wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
$ tar -zxvf ioncube_loaders_lin_x86.tar.gz

# copy the extension to somewhere
$ cp ioncube/ioncube_loader_lin_5.2.so /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/

# modify php.ini
$ vi /usr/local/webserver/php/etc/php.ini
zend_extension = /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/ioncube_loader_lin_5.2.so

[/codesyntax]

[codesyntax lang=”bash”]

# restart PHP and Nginx
$ /usr/local/webserver/php/sbin/php-fpm restart
$ /usr/local/webserver/nginx/sbin/nginx -s reload

[/codesyntax]

See : ionCube-Encoder-USER-GUIDE

Posted in Optimization, PHP | Tagged , | Leave a comment