PHP 強化模块 (eaccelerator)安装
时间:2014-10-23 15:46 来源:linux.it.net.cn 作者:it
1.先到eaccelerator官方网站下载软件包
http://eaccelerator.net/
2.解压
软件包在/root/ 解压到/usr/local/src
-
tar -zxvf /root/eaccelerator-eaccelerator-42067ac.tar.gz
复制代码
3.安装
-
cd eaccelerator-eaccelerator-42067ac/
-
phpize
-
./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config
-
make
-
make test
-
make install
复制代码
4. 预先载入 PHP 的模块:
-
echo "/usr/lib64/php/modules/" >> /etc/ld.so.conf.d/php.conf
-
ldconfig
复制代码
5.修改 php.ini
-
vim /etc/php.ini
复制代码
在最下面添加
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/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"
6.重启服务
-
service httpd restart
复制代码
7.测试
-
[root@localhost html]# vim phpinfo.php
复制代码
<?php phpinfo() ?>
访问phpinfo.php出现如下图所示表示安装正确
-
[root@localhost html]# ab -dSk -c 100 -n 100 <a href="http://192.168.124.149/phpinfo.php" target="_blank">http://192.168.124.149/phpinfo.php</a>
复制代码
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.124.149 (be patient).....done
Server Software: Apache/2.2.15
Server Hostname: 192.168.124.149
Server Port: 80
Document Path: /phpinfo.php
Document Length: 51319 bytes
Concurrency Level: 100
Time taken for tests: 1.118 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 5149100 bytes
HTML transferred: 5131900 bytes
Requests per second: 89.42 [#/sec] (mean)
Time per request: 1118.301 [ms] (mean)
Time per request: 11.183 [ms] (mean, across all concurrent requests)
Transfer rate: 4496.48 [Kbytes/sec] received
Connection Times (ms)
min avg max
Connect: 42 84 115
Processing: 106 615 960
Total: 148 699 1075 (责任编辑:IT)
1.先到eaccelerator官方网站下载软件包 http://eaccelerator.net/ 2.解压 软件包在/root/ 解压到/usr/local/src
extension="eaccelerator.so" eaccelerator.shm_size="16" eaccelerator.cache_dir="/tmp/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" 6.重启服务
访问phpinfo.php出现如下图所示表示安装正确
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.124.149 (be patient).....done Server Software: Apache/2.2.15 Server Hostname: 192.168.124.149 Server Port: 80 Document Path: /phpinfo.php Document Length: 51319 bytes Concurrency Level: 100 Time taken for tests: 1.118 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Keep-Alive requests: 0 Total transferred: 5149100 bytes HTML transferred: 5131900 bytes Requests per second: 89.42 [#/sec] (mean) Time per request: 1118.301 [ms] (mean) Time per request: 11.183 [ms] (mean, across all concurrent requests) Transfer rate: 4496.48 [Kbytes/sec] received Connection Times (ms) min avg max Connect: 42 84 115 Processing: 106 615 960 Total: 148 699 1075 (责任编辑:IT) |