糯米文學吧

位置:首頁 > 計算機 > php語言

PHP源代碼方式詳解

php語言3.55K

在使用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.編輯文件

標籤:源代碼 PHP