IonCube Loader 是一個 PHP 的模組, 可以載入已經編碼的 PHP 程式碼並正確執行。以下文章會介紹在 CentOS 下安裝 IonCube Loader.
1. 首先下載 IonCube Loader 模組到 DocumentRoot 目錄, 根據不同的系統下載合適的檔案:
64-Bits:
# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
32-Bits:
# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
2. 解壓下載回來的壓縮檔, 下面以 64-Bits 為例:
3. 然後用瀏覽器開啟解壓出來的 ioncube/loader-wizard.php 檔案, 例如:
http://your-server-ip/ioncube/loader-wizard.php
開啟了以上頁面後, IonCube Loader Wizard 會顯示那一個 .so 檔案適合已安裝了的 PHP 使用, 下面會以 ioncube_loader_lin_5.4.so 為例子:
4. 然後複製 IonCube Loader Wizard 顯示的那一個檔案到 PHP 模組目錄, 32-Bits 系統的目錄是 /usr/lib/php/modules; 64-Bits 系統的目錄是 /usr/lib64/php/modules:
5. 建立檔案 /etc/php.d/20ioncube.ini:
加入以下內容:
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.4.so
儲存檔安後離開編輯器。
6. 重新啟動 Apache:
7. 最後測試 IonCube Loader 正確安裝, 可以用瀏覽器開啟上面的 loader-wizard.php 頁面:
http://your-server-ip/ioncube/loader-wizard.php
在最下面的位置按 “When the server software has restarted, click here to test the Loader.”, 如果看到類似以下文字, 表示 IonCube Loader 運作正常:
|
1 2 3 |
Loader Installed Successfully The ionCube Loader version 5.0.18 for PHP 5.4 is installed and encoded files should run successfully. |