在使用PHP過(guò)程中發(fā)現(xiàn),自己編寫(xiě)的php代碼因?yàn)槎际窃创a方式放在服務(wù)器上的所以很容易就被別人拿走隨便修改(變成自己開(kāi)發(fā)的)使用了。 為了保住自己的勞動(dòng)成果,我一直尋找一種可以加密php代碼的軟件。 最著名的就是Zend公司的Zendencoder了,但是不是開(kāi)源軟件(要價(jià)很高,也沒(méi)有找到破解版)。 既然收費(fèi)的用不起,我們就用開(kāi)源的。我找到了php_screw這個(gè)開(kāi)源軟件,目前最新版本是1.5 安裝環(huán)境 系統(tǒng):centos 5.3 軟件:Apache 2.2.9 PHP 5.2.10 以上環(huán)境全部是自己下載配置安裝的。具體的Apache+php+mysql安裝方法請(qǐng)從網(wǎng)上搜索。 安裝 1.用tar解壓縮 tar -zxvf php_screw-1.5.tar.gz 2.進(jìn)入php_screw-1.5目錄開(kāi)始安裝 cd php_screw-1.5 phpize 關(guān)于phpize ,它在php5-dev擴(kuò)展模塊中 只要安裝php5-dev模塊就行了。 ./confiugre 3.設(shè)置自己用來(lái)加密的密碼 復(fù)制代碼 代碼如下: vi my_screw.h -- Please change the encryption SEED key (pm9screw_mycryptkey) into the html' target='_blank'>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.