Linux-Noob Forums

Full Version: install mmcache for php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

Maybe you have heard about Turck MMCache, basically it caches php code into memory to help speed up dynamic content based sites. Its a great little php addon for forums and heavily used sites. This will go through how to install mmcache for your rpm based installs for apache/php on fedora/redhat systems.


First lets download mmcache from sourceforge



Now lets extract it and go into the mmcache source directory


tar zxfv turck-mmcache-2.4.6.tar.gz
cd turck-mmcache-2.4.6


Now we need to set a var. If you are using the standard rpms it will be in /usr so lets set that.


export PHP_PREFIX="/usr"


Now lets compile mmcache


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


Now lets copy over the compiled mmcache module into the same place where the php module is installed for apache. This is just to keep it neater. You are free to put it anywhere you want. Just make sure you make the same changes below when we edit the php.ini file


cp modules/ /usr/lib/httpd/modules/


Now lets edit the php.ini file. It is in /etc/php.ini in the rpm installs. We want to add the following lines at the bottom of the file




Now lets make the temp directory for mmcache and then chmod it correctly


mkdir /tmp/mmcache
chmod 777 /tmp/mmcache


Now lets restart apache


service httpd restart


Now just load up a php page on your website and you should see files in the /tmp/mmcache directory. If you don't then change the zend_extension part to extension in your php.ini and then restart apache again.


Using mmcache should increase your php content driven sites around 1-10 times their load times and bring your load down on the server also since your server isn't always re-compiling php pages over and over again

worked great on fc1, thanks man. :)



Im using FC3 and i get stuck at "$PHP_PREFIX/bin/phpize" just after Now lets compile mmcache, that isnt a valid location for me!?


-bash-3.00# $PHP_PREFIX/bin/phpize

-bash: /usr/bin/phpize: No such file or directory


is the response i get, what am i doing wrong?



Carl. [img]<___base_url___>/uploads/emoticons/default_ph34r.png[/img]

Quote:-bash-3.00# $PHP_PREFIX/bin/phpize-bash: /usr/bin/phpize: No such file or directory

it is included in the php-devel rpm

Here is a simple benchmark I used to test using php v4.3.10 using mmcache vs no cache at all. I tested it by hitting the Invision Power Board forum index page 100 times over and over again


This are average load times for php to serve up the page


No Cache: 0.10593454837799

MMcache: 0.046741628646851


So doing some simple math.. we see that using mmcache will speed up the load time by 4 million percent :)ok not 4 million but i believe its around 226%. Thats pretty darn good


Here is the script I used


$file = "";
$iter = 100;

function getmtime()
$a = explode (' ',microtime());
return(double) $a[0] + $a[1];

for ($i = 0; $i < $iter; $i++)
$start = getmtime();
file ($file);
$loadtime += getmtime() - $start;
$intertime = getmtime() - $start;
echo $intertime . "<br>";
$avgload = $loadtime / $iter;
echo "<p><b>" . $avgload . "</b>";

Installed Php-devel and when i tryed to do "$PHP_PREFIX/bin/phpize"


I got the error "aclocal: command not found"


so I googled and found i had to install autoconf and automake

did that then i got the following..


-bash-3.00# $PHP_PREFIX/bin/phpize warning: underquoted definition of PHP_WITH_PHP_CONFIG
 run info '(automake)Extending aclocal'
 or see warning: underquoted definition of PHP_EXT_BUILDDIR warning: underquoted definition of PHP_EXT_DIR warning: underquoted definition of PHP_EXT_SRCDIR warning: underquoted definition of PHP_ALWAYS_SHARED
acinclude.m4:19: warning: underquoted definition of PHP_PROG_RE2C error: possibly undefined macro: AC_PROG_LIBTOOL
     If this token and others are legitimate, please use m4_pattern_allow.
     See the Autoconf documentation.


any clues on what i should do? ignore it?



Carl. [img]<___base_url___>/uploads/emoticons/default_ph34r.png[/img]

make sure you have libtool and libtool-libs installed

Quote:make sure you have libtool and libtool-libs installed


Thanks that and installing gtk+ & gcc-c++ solved my problems


Carl [img]<___base_url___>/uploads/emoticons/default_ph34r.png[/img]

hi everyone


did anyone install mmcache with Centos 3.4 ? if so, would you mind share your experience ? i have tried , but it seems like something wrong

what error did you get?
Pages: 1 2