I never quite understood how to configure memcached, so I gave it a try today and actually got it working First, download the files wget http://sourceforge.net/projects/erik1314/files/memcache/libevent-1.4.14b-stable.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcached-1.4.20.tar.gz wget http://sourceforge.net/projects/erik1314/files/memcache/memcache-2.2.1.tgz If you’re a beginner who isn’t comfortable with commands, you can just click the downloads below to save the files locally, then upload them to the server with ftp libevent-1.4.14b-stable.tar.gz memcached-1.4.20.tar.gz memcache-2.2.1.tgz For the sake of file integrity, it’s best to unpack them on the server Unpack the files tar xzfv libevent-1.4.14b-stable.tar.gz Give permissions chmod -R 777 libevent-1.4.14b-stable Enter the directory cd libevent-1.4.14b-stable Compile and install in one go ./configure (you can specify a directory here too, pick one that suits your setup) make && make install The author installed to the default /usr/local/lib/ directory
Installing memcached
Unpack memcached-1.4.20.tar.gz the same way tar zxvf memcached-1.4.20.tar.gz chmod -R 777 memcached-1.4.20 ./configure —prefix=/local/memcached (here the author specified the install directory) make && make install Then start it up ./memcached -d -u nobody -m 512 127.0.0.1 -p 11211
Installing the memcache PHP module
tar zxvf memcache-2.2.1.tgz chmod -R 777 memcache-2.2.1 cd memcache-2.2.1 Find phpize — it’s usually in the bin directory under the php directory; in the author’s case the directory is /alidata/php/bin/phpize Enter /alidata/php/bin/phpize ./configure —enable-memcache=/alidata/memcache/bin/memcached —with-php-config=/alidata/php/bin/php-config make && make install Then edit php.ini vi /alidata/php/etc/php.ini Change extension_dir = “./“ to extension_dir = “/alidata/php/lib/php/extensions/no-debug-non-zts-20060613” (this is usually generated automatically) Then add extension=”memcache.so” on the next line Restart httpd and you’ll see it in phpinfo.php [caption id=”attachment_48” align=”alignnone” width=”300”]
memcache installed successfully[/caption]

