Home > Backend Development > PHP Tutorial > PHP装配eAccelerator

PHP装配eAccelerator

WBOY
Release: 2016-06-13 13:04:49
Original
726 people have browsed it

PHP安装eAccelerator

文章来源:http://verydemo.com/demo_c116_i4224.html

eAccelerator是一个非常优秀的PHP加速器,通过缓存编译之后的PHP代码文件,使得PHP编译对服务器的开销几乎为零。eAccelerator本身的开销也是极少的

?

最新的PHP5.4.8安装eAccelerator,

需要注意的是要安装高版本的,低了编译不过去。

官网:http://eaccelerator.net/

?

1.下载安装eAccelerator

#wget https://github.com/eaccelerator/eaccelerator/tarball/master

最新的版本是eaccelerator-42067ac.tar.gz

#tar zxvf eaccelerator-42067ac.tar.gz

需要phpize安装php扩展,如果不明白phpize可以看这个:http://blog.csdn.net/21aspnet/article/details/8193482

需要注意的是需要写php的安装路径对应的phpize下面的php-config也是

#? /usr/local/webserver/php/bin/phpize

需要记住生成的提示信息下面配置php要用到

/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-

20100525/

#./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config

# make

需要注意的是要安装高版本的,低了编译不过去。

# make install

?

2.配置php.ini配置文件

#这个是我机器的so位置
extension="/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20100525/eaccelerator.so"
#这个是设置一个缓存大小
eaccelerator.shm_size="64"
#缓存目录
eaccelerator.cache_dir="="/usr/local/webserver/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_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

?

增加权限

#mkdir /usr/local/webserver/eaccelerator_cache
#chmod 777 /usr/local/webserver/eaccelerator_cache

?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template