php安装完成没有安装phpize解决方法以及安装eaccelerator扩展
偶然闲逛,突然发现我们以前的php机器竟然都没有安装php加速扩展,好吧!真是很无奈啊~~至于ubuntu下的几个系统,使用的是opcache这个加速器,这里不多说,详见以前文章http://addam.blog.51cto.com/5041993/1398511,今天主要说一下centos下已经安装好php,如何去添加加速扩展。
首先需要确认我们的php是否安装了phpize这个模块,我们在安装扩展的时候这个东东很重要,好吧!如果你的还没有安装,那么请执行如下命令:
yuminstallphp-devel
安装完成以后我们可以查看命令所在的位置
[root@addamphp.d]#whichphpize/usr/bin/phpize
记住这个路径哦,以后会用的很多。这里我们就可以继续安装eaccelerator这个加速模块了,其实不是我不想用opcache,而是我们的centos系统下的php版本太低了,只能用eaccelerator来加速了。废话不多说,直接上。
tarjxvfeaccelerator-0.9.6.tar.bz2cdeaccelerator-0.9.6/usr/bin/phpize#记住这里要用你自己的哦./configure-enable-eaccelerator-with-php-config=/usr/bin/php-configmake&&makeinstall
ok,这里安装完成后,我们可以看到我们的eaccelerator安装的路径,我的是在
/usr/lib64/php/models
接下来,把eaccelerator-0.9.6下面的eaccelerator.ini文件拷贝到php.d这个目录下,然后修改php.ini配置文件,在文件中追加如下内容:
[eaccelerator] extension="/usr/lib64/php/models/eaccelerator.so" eaccelerator.shm_size="512" eaccelerator.cache_dir="/data/cache/eaccelerator" 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-p/data/cache/eacceleratorchmod0777/data/cache/eaccelerator
最后重启php-fpm和nginx,然后可以写个测试页面来进行一下测试。
这里我们已经安装完成了。
参考文章:http://zyan.cc/post/202/
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。