How do I get the php module for memcache to work in SuSE 11.1 ? I have added the repo and YaST installed php-5mod_memcache but can’t get the apache server to use it.
First thing to check is that it is being loaded by PHP. Put this PHP script on your webserver and view it:
<?php
phpinfo();
?>
If memcache is not listed as a loaded module, you need to enable it. But do the test first.
Naturally you need to restart Apache after installing the module.
I have looked at the phpinfo and the module is not listed there. How do I enable it ?
Ok, what you need to do is put a file in /etc/php5/conf.d/memcache.ini. It should contain one line:
extension=memcache.so
This is assuming the loadable object file is in /usr/lib/php5/extensions (lib64 for 64-bit) and called memcache.so. You can check what was installed from the package with
rpm -ql php5-memcache
All this assumes that the memcache package was built for the same version of PHP that you are running. If it wasn’t, then all this probably doesn’t work. If it was a package for a different distro or even a different version of openSUSE, no way.
I have a bad feeling about this because normally the ini file is contained in the package and should enable the loadable object when the package is installed.
After adding that ini file, restart Apache and look at phpinfo again.
Ahh right. The repo I added has installed apache2-mod_memcache rather than the php5-memcache module which I actually can’t seem to find anywhere.
nice one, thanks ken. Had to update the php core files but got it installed now.