网络实验室

 找回密码
 注册账户
查看: 1238|回复: 3

Turck MMCache 的安装配置教程

[复制链接]
无心的棋子 发表于 2008-10-13 06:38:32 | 显示全部楼层 |阅读模式
Turck MMCache 的安装配置教程
Turck MMCache  是一个缓存工具
提升php的工作效率


Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. Also it uses some optimizations to speed up execution of PHP scripts. Turck MMCache typically reduces server load and increases the speed of your PHP code by 1-10 times.

Turck MMCache stores compiled PHP scripts in shared memory and execute code directly from it. It creates locks only for short time while search compiled PHP script in the cache, so one script can be executed simultaneously by several engines. MM shared memory library (http://www.engelschall.com/sw/mm/) was used by Turck MMCache before version 2.3.13 for management of shared memory and locking. Files those can't fit in shared memory are cached on disk only.

Important: If you have ionCube Loader installed this will render it usless and cause all ionCube loader scripts to stop working!

Since version 2.3.10, Turck MMCache contains a PHP encoder and loader. You can encode PHP scripts using encoder.php in order to distribute them without sources. Encoded files can be run on any site which runs PHP with Turck MMCache 2.3.10 or above. The sources of encoded scripts can't be restored because they are stored in a compiled form and the encoded version doesn't contain the source. Of course, some internals of the scripts can be restored with different reverse engineering tools (disassemblers, debuggers, etc), but it is not trivial.

Since version 2.3.15, Turck MMCache is compatible with Zend Optimizer's loader. Zend Optimizer must be installed after Turck MMCache in php.ini. If you don't use scripts encoded with Zend Encoder then we do not recommend you install Zend Optimizer with Turck MMCache.

Turck MMCache does not work in CGI mode.

Turck MMCache now BEATS Zend Accelerator and all other PHP accelerators in benchmark tests. So it's currently the BEST PHP accelerator around, even against commercial products, despite being free.

Click here for benchmark tests results:
http://turck-mmcache.sourceforge.net/#bench

Follow the instructions and you will uninstall PHPA or ZEND, and replace it with Turck MMCache.

Installation:
安装:
Upgrade instructions are the same as installation. Note the lines in red which are different to previous instructions.

1) Login as root in SSH
以root用户权限登录ssh
2) Run the following commands in the following order:
运行
cd /
mkdir mmcache
cd mmcache
wget http://unc.dl.sourceforge.net/so ... mcache-2.4.6.tar.gz
tar xvzf turck-mmcache-2.4.6.tar.gz
cd turck-mmcache-2.4.6
export PHP_PREFIX="/usr"
注意: This could also be: export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
./configure --enable-mmcache=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install

3) Edit php.ini - usually it's /etc/php.ini or /usr/local/lib/php.ini
编辑 php.ini文件
Find this:
查找:
;Windows Extensions
Above this, comment out the PHPA or ZEND lines if you have them. Replace them with this:
To install as a ZEND extension:

zend_extension="/mmcache/turck-mmcache-2.4.6/modules/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"

OR to install as a PHP extension:
extension="/mmcache/turck-mmcache-2.4.6/modules/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"

4) Create the cache directory by doing the following at the command line
创建缓存文件夹
mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache
改权限为777可写
5) Restart Apache
重启apache
service httpd restart

搞定 Done!

Copy the mmcache.php file in the mmcache directory to a directory that is web-accessible, and run it.
You should be able to see a list of cached scripts as well as the above information.

Turck MMCache 2.4.6

MMCache support enabled
Caching Enabled true
Optimizer Enabled true
Memory Size 33,554,392 Bytes
Memory Available 23,737,176 Bytes
Memory Allocated 9,817,216 Bytes
Cached Scripts 110
Removed Scripts 0
Cached Keys 0

You should see the following:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies with Turck MMCache v2.4.6, Copyright (c) 2002-2003 TurckSoft, St. Petersburg, by Dmitry Stogov

As well as the info shown above.
tianxiahui 发表于 2008-10-26 13:15:37 | 显示全部楼层
好东西
sean0407 发表于 2008-12-9 16:14:34 | 显示全部楼层
嗯嗯......

找了不少

希望這次可以成功~
hkbnp 发表于 2009-1-23 16:30:41 | 显示全部楼层
什么内容呢,看看
您需要登录后才可以回帖 登录 | 注册账户

本版积分规则

黑屋|存档|手机|网络实验室 本站服务器由美国合租以及IDCLayer国际数据提供!!!

GMT+8, 2024-5-6 00:55 , Processed in 0.090103 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表