ZendGuard对PHP加密

参考连接: http://blog.coinidea.com/web%E5%BC%80%E5%8F%91/php-1103.htmlphp

ZendGuard下载

官方下载地址:http://www.zend.com/en/products/guard/downloads#Windowshtml

下载以前须要注册,我下的版本是Zend Guard 6.0。双击运行便可傻瓜式安装。web

image

最新的版本是7.0,若是想下载早期的版本,请点击:>Download here,当前页面下方会弹出早期版本的列表。shell

[图片上传中...(image-3bbff-1535337238770-1)]windows

PHP下载

官方下载地址:http://php.net/downloads.php | http://php.net/releases/安全

我如今的版本是:http://windows.php.net/download/#php-5.4app

php一个版本通常会发布两种类型的程序,一种是线程安全的(Thread Safe),另外一种是非线程安全的(Non Thread Safe)。ide

值得注意的是:ZendGuard只支持非线程安全的。因此请选择非线程安全的PHP下载。wordpress

配置PHP——ZendLoader.dll

1. 下载ZendLoader.dllui

官方下载地址:

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

下载以前请注册,与ZendGuard下载类型,注意选择对应PHP版本的ZendLoader。

image

将ZendLoader.dll拷贝到PHP

[PHP的根目录]\ext\中。 2. 修改php.ini-development或者php.ini-production为php.ini, 在php.ini文件中添加如下内容:

zend_extension="./ext/ZendLoader.dll"

; Enables loading encoded scripts. The default value is On

zend_loader.enable=1

; Disable license checks (for performance reasons)

zend_loader.disable_licensing=0

; The Obfuscation level supported by Zend Guard Loader. The levels are detailed in the official Zend Guard Documentation. 0 - no obfuscation is enabled

zend_loader.obfuscation_level_support=3

; Path to where licensed Zend products should look for the product license. For more information on how to create a license file, see the Zend Guard User Guide

zend_loader.license_path=

新建PHP代码 新建input文件夹,在input文件夹中新建test.php。

代码以下:

<?php 
date_default_timezone_set("Asia/shanghai"); 
echo "Thanks ZendGuard!\n"; 
echo "Now datetime is ".date("Y-m-d h:i:s")."\n"; 
?>

上述代码输出:

Thanks ZendGuard

Now datetime is 当前时间.

ZendGuard安装及新建项目

ZendGuard是傻瓜式安装,安装以后,运行起来,效果以下。

image

1. 新建Zend Guard Project工程。

2. 指定输出文件为output文件夹。

image

3. 添加输入文件夹为input文件夹。

4. 选择PHP版本

image

5. 点击image

6. output文件夹中新生成了test.php,打开看是乱码。

运行源代码及加密代码

运行源代码效果:

image

运行加密代码效果:

image

至此,就能够用ZendGuard就能够对PHP代码进行加密。

参考连接: http://blog.coinidea.com/web%E5%BC%80%E5%8F%91/php-1103.html

相关文章
相关标签/搜索