How To Install IonCube Loader


How To Install IonCube Loader
--------------------------------

See: https://www.digitalocean.com/community/tutorials/how-to-install-ioncube-loader


IonCube is a PHP module extension that loads encrypted PHP files and speeds up webpages that are being displayed.

It is often required for a lot of PHP-based applications.


IonCube on 64-bit linux systems
----------------------------------

1.  First, you will need to download and extract the IonCube Loader PHP modules.
    首先, 你需要下载和解压 IonCube Loader PHP模块:

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

2.  Then, you will have to copy the appropriate module to the PHP modules folder. To find that folder's path, run the following command.
    然后, 你需要拷贝 IonCube Loader 模块到 PHP 的模块安装目录里, 为了找到这个 PHP 模块安装路径, 可以使用下面的命令:

        php -i | grep extension_dir

    You will get the following output:
    你将得到下面的输出结果:

        extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs

    Now you should copy over the module to your PHP modules folder:
    现在你可以复制适合你的 PHP 版本的 IonCude Loader 模块到 PHP 模块安装路径里:

        PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
        sudo cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" /usr/lib/php5/20090626+lfs/

    You would then have to restart Apache2 or php5-fpm (if you're using nginx) for the module to be loaded:
    我们需要重启 Apache2 或者 php5-fpm (如果你使用 nginx 的话), 然后 IonCude Loader 模块将会被加载和生效:

        service apache2 restart
        service php5-fpm restart

    To ensure that the module was correctly installed, create a file called test.php in /var/www with the following content:
    为了确认 IonCude Loader 模块是否已经正确的安装了, 在 /var/www 下面创建一个 test.php 文件, 内容是这样的:


        <?php echo var_export(extension_loaded('ionCube Loader') ,true); ?>

    Once you have done that, navigate to http://your-droplets-ip-address/test.php. It should output "true".
    当你创建好了以后, 打开浏览器访问 http://your-droplets-ip-address/test.php , 页面将会显示 "true" 的结果.


IonCube on 32-bit linux systems
----------------------------------

    If you have installed your own LAMP stack on a 64-bit Linux, you would need to download a 64 bit package:
    如果你是在 32bit linux 系统下面使用的话, 使用下面的命令下载安装包即可:

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

    You should proceed with same steps as outlined above.
    后面的步骤都是跟 64bit 上一样的.

    And you are all done!

你可能感兴趣的:(How To Install IonCube Loader)