Zend Guard 是成熟的 PHP 原始碼加密產品。本文記錄在 WampServer (PHP 5.3.10) 環境下,從安裝、授權破解、專案加密到執行環境部署的完整流程與坑點。
zend_guard.zl,於 Help → Register → Search for a license file on my disk 選取啟用。File → New → Zend Guard Project,填寫專案名、輸出路徑。Add File/Add Folder)。Finish 完成,在 Guard Explorer 右鍵專案選 Encode Project 產出加密檔。加密檔需 Zend Guard Loader 擴充模組才能執行。
ZendGuardLoader-php-5.3-Windows)。ZendLoader.dll,放入 PHP ext/ 目錄。php.ini 加入:[Zend.loader] zend_loader.enable=1 zend_loader.disable_licensing=1 zend_loader.obfuscation_level_support=3 zend_loader.license_path= zend_extension="你的PHP安裝目錄\ext\ZendLoader.dll"
重啟 WampServer 後若仍報 Zend Guard Run-time support missing!,請檢查 phpinfo():
Thread Safety = enabled → TS 版本Thread Safety = disabled → NTS 版本Zend Guard Loader 僅支援 NTS 版本 PHP。 若你的 PHP 是 TS(Windows 官方預設多為 TS),必須改裝 NTS 版本 PHP 才能載入 Loader。
bin\php\php5.3.10\ 目錄內容(或新增版本並切換)。php.ini 載入 ZendLoader.dll。