Turck MMCache

2004 May 4 at 08:15 » Tagged as :

Trying my hand at Turck MMCache - a PHP optimizer, encoder and caching system. I have long known the benefits of such systems. (my first encounter with a php encoder was the first release of the zend encoders (which was hugely overpriced at the time)) It is just that I never found the time until now to try it out.

The first attempt was not very successful. I had a heap of error messages that went something like:

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c: In function `calc_op_array':

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c149: structure has no member named `arg_types'

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c150: structure has no member named `arg_types'

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c150: structure has no member named `arg_types'

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c: In function `store_op_array':

.....

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c:4312: initializer element is not constant

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c:4312: (near initialization for `mmcache_second_arg_force_ref[2]')

/opt/webstuff/turck-mmcache-2.3.22/mmcache.c:4321: warning: initialization from incompatible pointer type

I suspected the cause to be a confusion caused by having two installation of php (4.x and 5 beta 2) on the same machine. So I did a make install again with the php 4 installation to make sure the binaries in my /usr/local/ folder are the ones from 4.x

Then I gave the compilation of turck another shot. This time the make step did not throw a gasket like it did earlier. After running make install I found, I copied the test script to the webspace and loaded it in the browser to find it telling me that "Turck MMCache is not installed". Of course I did restart the apache web server so that's is not obviously where the problem lies.

Further investigations revealed that the mmcache.so files was not been copied to the right locations. after copying it manually and tweaking the php.ini file I reloaded the test script in my browser. Finally the module was installed but I had not bothered to add the --disable-cgi directive when first compiling PHP so mmcache refused to start. I had to go back and recompile PHP all over again for mmcache to start up. It looks promising.