Thursday, September 17, 2009

Steps to install memcache


1)# which phpize

2)If the result is usr/bin/phpize then run the command

#export PATH=/opt/lampp/bin:$PATH.

3)Install memcached using

#apt-get install memcached.

4)Download memcache client using the command

#wget http://pecl.php.net/package/memcache/memcache-2.2.5.tar.gz

5)Extract the downloaded package using the command

#tar -xzf memcache-2.2.5.tar.tz

6)# cd memcache-2.2.5

7)# /opt/lampp/bin/phpize

8)# ./configure -enable-memcache -with-php-config=/opt/lampp/bin/php-config-5.1.6(your php version)

9)If u get “c compiler cannot create executable files” then u need to run

#apt-get install build-essential

10)If u get Zlib-dir not found then u need to execute

#./configure -enable-memcache –with zlib-dir=/opt/lampp –with-php-config=/opt/lampp/bin/php-config-5.1.6(your php version)

11)# make

12)# make install

13)open php.ini and search for extension and add

extension=” memcache.so”

and

when we execute make install it will give you the extensions folder path copy that and add it in php.in.

For example:

when we execute make install command the path displays like

“/opt/lampp/lib/php/extensions/no-debug-non-zts-20050922” and now we need to add the below statement to php.ini

“extension-dir=/opt/lampp/lib/php/extensions/no-debug-non-zts-20050922 to php.ini”

14)Restart your server

15)Open browser and give http://localhost/xampp/phpinfo

search for memcache in browser you will find it else again run the complete steps again.

No comments:

Post a Comment