网站首页 语言 会计 互联网计算机 医学 学历 职场 文艺体育 范文
当前位置:学识谷 > 计算机 > php语言

PHP源代码方式详解

栏目: php语言 / 发布于: / 人气:2.65K

在使用PHP过程中发现,自己编写的php代码因为都是源代码方式放在服务器上的所以很容易就被别人拿走随便修改(变成自己开发的)使用了。为了保住自己的劳动成果,我一直寻找一种可以加密php代码的软件。跟随小编去看看吧!

PHP源代码方式详解

最著名的就是Zend公司的Zendencoder了,但是不是开源软件(要价很高,也没有找到破解版)。

既然收费的用不起,我们就用开源的。我找到了php_screw这个开源软件,目前最新版本是1.5

  安装环境

系统:centos 5.3

软件:Apache 2.2.9

PHP 5.2.10

以上环境全部是自己下载配置安装的。具体的Apache+php+mysql安装方法请从网上搜索。

  安装

  1.用tar解压缩 tar -zxvf php_

  2.进入php_screw-1.5目录开始安装

cd php_screw-1.5

  phpize

关于phpize ,它在php5-dev扩展模块中 只要安装php5-dev模块就行了。

./confiugre

  3.设置自己用来加密的密码

复制代码 代码如下:

vi my_screw.h

-- Please change the encryption SEED key (pm9screw_mycryptkey) into the

values according to what you like.

The encryption will be harder to break, if you add more values to the

encryption SEED array. However, the size of the SEED is unrelated to

the time of the decrypt processing.

* If you can read and understand the source code, to modify an original

encryption logic will be possible. But in general, this should not

be necessary.#

OPTIONAL: Encrypted scripts get a stamp added to the beginning of the

file. If you like, you may change this stamp defined by

PM9SCREW and PM9SCREW_LEN in php_screw.h. PM9SCREW_LEN must

be less than or equal to the size of PM9SCREW.

  4.编译

make

  5.拷贝modules目录下的`php_文件到/usr/lib/php5/extension目录下

cp modules/php_ /usr/lib/php5/extension/

  6.编辑文件

Tags:源代码 PHP