centos install memcached and memcache php module

1. yum install memcached
2a. wget http://pecl.php.net/get/memcache-3.0.6.tgz
2b. tar -xvf memcache-3.0.6.tgz

here is a little storry, we need to use phpize to prepare the imagick php extension for compiling.
On my server I have multiple php installations and if I use phpize directly it will compile the extension for a wrong version of php. Even if I try using phpize with an absolute path the end result will still be wrong and I’ll get the following errors inside my apache error log:
“PHP Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match”

so keeping the story short I backup/rename (temporary) the default php include directory:
3. rename /usr/local/include/php to /usr/local/include/_php (in my case)
I create a symlink inside /usr/local/include/ called php that points to the php include version I whish to compile the imagemagick extension, in this case it will point to /usr/local/php-5.3.2-fcgi/include/php

4. now I continue with:
/usr/local/php-5.3.2-fcgi/bin/phpize

5. I configure with the right php-config file:
./configure –with-php-config=/usr/local/php-5.3.2-fcgi/bin/php-config

6. and the usual
make
make install

7. now check where the imagick.so file was copied to and include it in your php.ini:
extension=/usr/…/extensions/memcache.so

8. start memcache server
memcached -d -u nobody -m 1048 -p 11211 127.0.0.1

9. restart apache
/etc/init.d/httpd restart