當前位置:才華齋>計算機>php語言>

PHP原始碼方式詳解

php語言 閱讀(3.93K)

在使用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.編輯檔案