phpinfo() 會報錯php -v # 輸出範例: # PHP 5.3.29 (cli) (built: Aug 14 2014 15:22:34) # Copyright (c) 1997-2014 The PHP Group # Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies # # 關鍵:若無 "Thread Safe" 字樣即為 NTS 版本 # 若為 TS,必須重裝 NTS 版 PHP
ZendLoader.dll (NTS 版在 ZendGuardLoader-php-5.3-Windows 目錄)# 建議放在 PHP ext 目錄 copy ZendLoader.dll D:\php\ext\
; 找到 [Zend] 區塊或檔案末尾新增 [Zend.loader] zend_extension = "D:\php\ext\ZendLoader.dll" zend_loader.enable = 1 zend_loader.disable_licensing = 1 zend_loader.obfuscation_level_support = 3 zend_loader.license_path =
關鍵參數說明:
zend_extension:絕對路徑,不可用相對路徑disable_licensing:1 = 忽略授權檢查 (適用無授權檔案)obfuscation_level_support:3 = 支援最高混淆等級# IIS iisreset /restart # Nginx + PHP-FPM taskkill /f /im php-cgi.exe start php-cgi.exe -b 127.0.0.1:9000 -c D:\php\php.ini
搜尋輸出應包含:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
| 現象 | 原因 | 解決 |
|---|---|---|
| php -m 無 Zend Guard Loader | DLL 路徑錯誤 / TS/NTS 不符 | 確認 phpinfo() 的 Extension Build: API20090626,NTS;DLL 必須同版本 |
| Apache/Nginx 500 錯誤 | zend_extension 指令寫錯位置 | 必須在 [Zend] 區塊或檔案最前,不可在 [PHP] 區塊 |
| 加密檔案無法執行 | 混淆等級過高 / 授權檢查失敗 | 設定 obfuscation_level_support=3、disable_licensing=1 |
| 多 PHP 版本共存衝突 | 載入錯誤版本 DLL | 每版本獨立 php.ini、獨立 ext 目錄、獨立 ZendLoader.dll |
zend_loader.enabled 納入健康檢查Windows PHP 5.3 安裝 Zend Guard Loader 核心三要素:**NTS 版本匹配、zend_extension 絕對路徑、disable_licensing=1**。驗證以 phpinfo() 輸出 "with Zend Guard Loader" 為準。強烈建議規劃升級路徑,棄用 EOL 版本。