eAccelerator 是一個非常好用的 PHP 加速器,目前支援 PHP4 及 PHP5 。而且還提供 PHP 編碼程式,以保護商業智慧。
Windows 版安裝方式
先連上最新版的 eAccelerator for Windows 的下載位址,然後找到和系統 PHP 版本相符的 eAccelerator095_5.2.0.dll ,將它下載到 PHP 安裝目錄 的 ext 子資料夾裡。
請記得設定 php.ini 的 extension_dir=”c:/php5/ext/” ;或是把 Windows 的 PATH 系統變數後面加上「 ;c:\php5\ext 」,然後重新啟動電腦。
註:有時候 Windows 還是不能找到 ext 底下的 dll 檔 (例如 PHP 5.1 就會如此) ,這時候只要把 “c:\php5\ext;” 改加在 PATH 變數之前就行了。例如:
1
| c:\php5;c:\php5\ext;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
|
接著在 php.ini 中加入:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| [eAccelerator]
zend_extension_ts=eAccelerator095_5.2.0.dll
eaccelerator.shm_size="64"
eaccelerator.cache_dir="D:/TEMP/eAccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.debug="0"
eaccelerator.check_mtime="1"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="shm_and_disk"
eaccelerator.sessions="shm_and_disk"
eaccelerator.content="shm_and_disk"
|
最後重新啟動 Apache ,用 phpinfo() 查看是否安裝正確。

安裝 PHP 編碼程式
連到這個位址,下載 phpcoder-multiencoder-x.x.x.zip 。然後把所有檔案解壓縮至可執行 PHP 的資料夾裡。
接著修改其中的 index.php ,找到:
1
| $coder = &NewEncoder("mmcache");
|
改成:
1
| $coder = &NewEncoder("eAccelerator");
|
存檔後便可試著執行看看;使用方法就請自行嘗試了。