Windows下eAccelerator安装配置步骤
官方下载地址:http://www.arnot.info/eaccelerator/
请根据您使用的操作系统及PHP版本,下载对应的eAccelerator组件。
将下载的文件重命名为eaccelerator.dll(Windows版本),然后将其移动到PHP安装目录下的ext文件夹中。
在C:\php目录下创建一个名为temp的缓存文件夹,并将其权限设置为允许user组进行读写操作。
根据您的系统环境,通常PHP扩展采用ISAPI模式运行。
打开php.ini配置文件,找到extension=php_zip.dll这一行,在其下方添加相应的配置代码。
添加 zend_extension_ts="C:\php\ext\eaccelerator.dll",请注意路径需根据您的实际系统情况进行调整,且文件扩展名也需保持一致。
设置 eaccelerator.shm_size="64",该值取决于您的系统内存大小,默认值为16M,可根据需要调整为64M。
配置 eaccelerator.cache_dir="C:\php\temp",需手动创建该目录(例如C:\php\temp),确保其具有读写权限,并且在后续使用中不要随意更改此目录位置。
启用功能 eaccelerator.enable="1"
开启优化器 eaccelerator.optimizer="1"
检查修改时间 eaccelerator.check_mtime="1"
关闭调试模式 eaccelerator.debug="0"
设置过滤规则 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"
将修改好的php.ini文件放入您的PHP配置目录,在Windows Server 2003系统中,该目录通常为c:\windows\。
┌──────┐
判断加速启动
└──────┘
在重启IIS之前,查看PHP信息页面,此时仅显示Zend相关的信息。
加载eaccelerator.dll之后,如果PHP信息显示包含“with eAccelerator”,则说明加载成功。