程序说明
eAccelerator是一个自由开放源码php加速器,优化和动态内容缓存,提高了php脚本的缓存性能,使得PHP脚本在编译的状态下,对服务器的开销几乎为零。 它还有对脚本起优化作用,以加快其执行效率。使您的PHP程序代码执效率能提高1-10倍。eAccelerator本身的开销也是极少的。
1、程序下载
###服务器上之间下载###
[root@web-yv3 ~]# wget https://github.com/eaccelerator/eaccelerator/tarball/master
[root@web-yv3 ~]# ll
-rw-r--r-- 1 root root 131579 Nov 29 17:34 master #此文件就是下载的eAccelerator的安装包,勿惊勿惊!!
###官网自行下载###
http://eaccelerator.net/
eaccelerator-eaccelerator-42067ac.tar.gz
通过rz上传或ftp上传!!
2、编译安装加速器
2.1、解压程序
[root@web-yv3 ~]#tar xf master #常规方式解压
[root@web-yv3 ~]# ls
eaccelerator-eaccelerator-42067ac master
[root@web-yv3 ~]# cd eaccelerator-eaccelerator-42067ac #已经露出了庐山真面目!
2.2、查看phpize
phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块。
[root@web-yv3 ~]# cd eaccelerator-eaccelerator-42067ac
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# whereis phpize
phpize: /usr/bin/phpize /usr/share/man/man1/phpize.1.gz
2.3、执行phpize
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# /usr/bin/phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
2.4、查看php-config
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# whereis php-config
php-config: /usr/bin/php-config /usr/share/man/man1/php-config.1.gz
2.5、编译安装
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# ./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# make
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# make install
Installing shared extensions: /usr/lib64/php/modules/ ##记录此安装位置
+-------------------------------------------------------+
| !!! Attention !!! |
| |
| For disk cache users (using eaccelerator.shm_only=0): |
| |
| Please remember to empty your eAccelerator disk cache |
| when upgrading, otherwise things will break! |
+-------------------------------------------------------+
2.6、设置配置文件
[root@web-yv3 eaccelerator-eaccelerator-42067ac]# vi /etc/php.ini
extension="/usr/lib64/php/modules/eaccelerator.so"
eaccelerator.shm_size="64"
eaccelerator.cache_dir="/data/eaccelerator_cache"
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_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
关注公众号,解锁完整文章
微信扫码关注 星哥玩云,
在公众号对话框回复关键词 星哥玩云博客 获取验证码。输入后即可阅读全文,
一次解锁全站文章通用。