HowTo: Install Turck MMCache

jmstacey

Verified User
Joined
Feb 12, 2004
Messages
4,106
Location
Colorado
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
Code:
tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`
tagnames=`echo "$tagnames,F77" | sed 's/^,//'`
and comment them out (put a # in front of them)

Please notify me if something doesn't work :)
 
Last edited:
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


i did this :
hercules# which php
/usr/local/bin/php

i don't understand step 3 and when i whant to do step 4 i get :
Code:
hercules# ./configure --enable-mmcache=shared --with-php-config=/usr/local/bin/bin/php-config
./configure: Command not found.
 
Step 3 runs phpize which creates the configure files so you can continue.
Did you sucessfully run that command in the turck mmcache directory?
 
Code:
hercules# php prefix /usr/local/bin/bin/phpize
Could not open input file: prefix.

Something like this ?
 
no, the php prefix IS /usr/local/bin

so you use prefix/phpize which would be:

Code:
/usr/local/bin/phpize
 
I get


[root@serv1 turck-mmcache-2.4.6]# phpize
configure.in:65: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

Whenever i run the phpize command.. Whats wrong. I have zend installed..
 
You might want to make sure you have all the required tools installed properly, or reinstall the latest versions.

Also, did you try using the m4_pattern_allow thing?
 
If i knew what that means and what i need to do to use it i probably wouldnt get that error..
 
Hi,
i have run:
/usr/local/bin/phpize
and i have the error:
aclocal: not found

I use freebsd 4.10
any help?
Christos
 
Ok few month later new install of Fedora core 2 with php 4.3.10

[root@web eaccelerator]# which php
/usr/local/bin/php

[root@web eaccelerator]# ./configure --enable-eaccelerator=shared --with-php-config=/usr/local/bin/php-config
-bash: ./configure: No such file or directory

eaccelerator are some developer that are using the last version of mmcache . I have the same errors with mmcashe
 
thx but i can't find where to put it in php.ini and i can't find mmcache.php and mmcache_password.php...

it supports php5?
 
blueice said:
Hi,
i have run:
/usr/local/bin/phpize
and i have the error:
aclocal: not found

Make sure you have all the necassary build tools required such as automake and so on.


Thafusion: Make sure you have the latest release of TurckMMCache from the official TurckMMCache website and that you are in the correct directory.


hackerpitbull: As far as I know, the last release of TurckMMCached did not support php5.
The .php files should have been located somewhere in the extracted mmcache directory.
 
jmstacey said:
hackerpitbull: As far as I know, the last release of TurckMMCached did not support php5.
The .php files should have been located somewhere in the extracted mmcache directory. [/B]
i use php5 blah =\
 
Thanks for the guide!
I got it installed on my Fedora 2 Server.

But.. I have one problem.
Where is the mmcache.php file is located?
I tried to do "locate mmcache.php",
but i didnt find anything.

I want to see that this installed on my system,
because I dont want to use ionCube again :(.

Edit:
I found mmcache.php.
It's on the folder that i decompressed/turck-mmcache-v.e.r/mmcache.php
 
Last edited:
Thanks for your tutorial. But I have one problem, it conflicts with my ioncube encoder extension.

If I disable it, it still won't work. So how can I only load it if ioncube is not needed?

Thanks,
ja3

If you have PHP5 try www.eaccelerator.net
 
ja3 said:
Thanks for your tutorial. But I have one problem, it conflicts with my ioncube encoder extension.

If I disable it, it still won't work. So how can I only load it if ioncube is not needed?

Thanks,
ja3

If you have PHP5 try www.eaccelerator.net
"This version of the eAccelerator has been successfully tested on PHP
4.1.0-4.3.3 under RedHat Linux 7.0, 7.3, 8.0 and Windows with Apache 1.3
and Apache 2.0."
 
Yair(I know you from Hosts), I'll open a VPS on my server and test it for you.
If it working, I'll update here in a new theard, because this theard is for Turck MMCache only.
 
2004/12/20 - eAccelerator 0.9.1
eAccelerator 0.9.1 is available for Download. Should be PHP5 ready, but we need yours feedbacks.
 
ja3 said:
2004/12/20 - eAccelerator 0.9.1
eAccelerator 0.9.1 is available for Download. Should be PHP5 ready, but we need yours feedbacks.
well m8 bcz i use my server for a hosting biz - i can't use unstable version. thx anyway :)
 
Back
Top