NOTICE: TurckMMCache will probably not work with newer versions of PHP. I recommend eAccelerator which was forked from TMMC.
This HowTo has been only been tested on FreeBSD 4.x but should work for all Operating Systems with the required tools.
Required Tools
apache 1.3.xx
mod_php
autoconf
automake
libtool
m4
1. Download Turck MMCache, extract it and cd into it
wget http://aleron.dl.sourceforge.net/sourceforge/turck-mmcache/turck-mmcache-2.4.6.tar.gz
tar -zxf turck-mmcache-2.4.6.tar.gz
cd turck-mmcache-2.4.6
2. Locate php and find where its installed
which php
Example Output: "/usr/local/php" ignore the /php, all we want is the prefix to the php
directory. In my case it was "/usr/local"
*All commands that are purple denote where you should substitue your
php prefix
3. Create the configure files using the php prefix from the previous step
/usr/local/bin/phpize
4. Compile Turck MMCache.
./configure --enable-mmcache=shared --with-php-config=/usr/local/bin/php-config
make
make install
If there were no errors and it appeared to compile successfully please note where it put mmcache.so and we'll move on to the next step.
5. Configure Turck MMCache
I assume you are going to use Turck MMCache as a zend extension, as such the following reflect
that. You can use it as a php extension by removing the zend from the first line "zend_extension...." but
I haven't messed with that.
Edit your php.ini file and add the following right above the Zend entries.
It is very important to add it ABOVE the zend configurations otherwise nothing will work.
[mmcache]
#the location of mmcache.so will vary on your installation
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"
6. Create the cache directory
mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache
7. Test and make sure its working by placing the mmcache.php file in a publicly accessible location and try to access it from the web. If it works it will display a information page similar to the php info page.
Recommended -- Since you control Turck MMCache through the mmcache.php file, its probably not the best idea to allow the entire world access to it.
Move the mmcache_password.php file to a publicly accessible location and access it. Fill in a username and password and do what it tells you when it generates the key (You'll have to edit your php.ini file again )
After you have completed that, try accessing the mmcache.php file and make sure it requires authentication to access it, if so you can delete the mmcache_password.php and turck-mmcache-2.4.6[/b] directory at tar.
Troubleshooting
If you get a configure error on step #4 like error: tag name "CXX" already exists
Open the configure file and search for the following two entries
and comment them out (put a # in front of them)
Please notify me if something doesn't work
This HowTo has been only been tested on FreeBSD 4.x but should work for all Operating Systems with the required tools.
Required Tools
apache 1.3.xx
mod_php
autoconf
automake
libtool
m4
1. Download Turck MMCache, extract it and cd into it
wget http://aleron.dl.sourceforge.net/sourceforge/turck-mmcache/turck-mmcache-2.4.6.tar.gz
tar -zxf turck-mmcache-2.4.6.tar.gz
cd turck-mmcache-2.4.6
2. Locate php and find where its installed
which php
Example Output: "/usr/local/php" ignore the /php, all we want is the prefix to the php
directory. In my case it was "/usr/local"
*All commands that are purple denote where you should substitue your
php prefix
3. Create the configure files using the php prefix from the previous step
/usr/local/bin/phpize
4. Compile Turck MMCache.
./configure --enable-mmcache=shared --with-php-config=/usr/local/bin/php-config
make
make install
If there were no errors and it appeared to compile successfully please note where it put mmcache.so and we'll move on to the next step.
5. Configure Turck MMCache
I assume you are going to use Turck MMCache as a zend extension, as such the following reflect
that. You can use it as a php extension by removing the zend from the first line "zend_extension...." but
I haven't messed with that.
Edit your php.ini file and add the following right above the Zend entries.
It is very important to add it ABOVE the zend configurations otherwise nothing will work.
[mmcache]
#the location of mmcache.so will vary on your installation
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"
6. Create the cache directory
mkdir /tmp/mmcache
chmod 0777 /tmp/mmcache
7. Test and make sure its working by placing the mmcache.php file in a publicly accessible location and try to access it from the web. If it works it will display a information page similar to the php info page.
Recommended -- Since you control Turck MMCache through the mmcache.php file, its probably not the best idea to allow the entire world access to it.
Move the mmcache_password.php file to a publicly accessible location and access it. Fill in a username and password and do what it tells you when it generates the key (You'll have to edit your php.ini file again )
After you have completed that, try accessing the mmcache.php file and make sure it requires authentication to access it, if so you can delete the mmcache_password.php and turck-mmcache-2.4.6[/b] directory at tar.
Troubleshooting
If you get a configure error on step #4 like error: tag name "CXX" already exists
Open the configure file and search for the following two entries
Code:
tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`
tagnames=`echo "$tagnames,F77" | sed 's/^,//'`
Please notify me if something doesn't work
Last edited: