All pastes #207080 Raw Edit

Unnamed

public text v1 · immutable
#207080 ·published 2006-10-17 19:45 UTC
rendered paste body
3. Install Turck MMCache for PHP

Description: "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 requires: apache 1.3, mod_php 4.1, autoconf, automake, libtool, m4. You should already have most of these on your server if not use the "apt-get install <dependency here>" command to get them installed. I won't go into detail about this here, you should easily be able to search the net to get them installed.

To install Turck MMCache, perform the following commands via SSH:

wget http://aleron.dl.sourceforge.net/sou...e-2.4.6.tar.gz

export PHP_PREFIX="/usr"

$PHP_PREFIX/bin/phpize

./configure --enable-mmcache=shared --with-php-config=$PHP_PREFIX/bin/php-config

(You must specify the real prefix where PHP is installed in the "export" command. It may be "/usr" "/usr/local", or something else.)

make

make install

Turck MMCache can be installed both as Zend or PHP extension, so you need to edit your php.ini file (usually /etc/php.ini).
To install as Zend extension:

zend_extension="/usr/lib/php4/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"

To install as PHP extension:

extension="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"

You may need to copy the mmcache.so file to the directory specified to the above paths in the configuration entries.

Create the cache directory:
mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache

Restart Apache with:

service httpd restart
OR
/etc/rc.d/init.d/httpd restart