how to install memcached on centos

how to install memcached on centos

We given steps for install memcached on centos. Memcached server is used for increase server performance and response time. Here we given the commands for installing memcached on centos.

how to install memcached on centos

I always need to install the memcached on my linux servers like fedora or centos. On fedora box installing the memcached is very easy through yum install. But Centos installing and using memcached is not so easy.

how to install memcached on centos
how to install memcached on centos

For my Ruby on Rails and PHP applications I always need to install the memcached on server. Here I am going to give you the steps for installing the memcached.

Very important note: you need to install the gcc compiler for memcached binary installation. Using the memcached with php installation you need the phpize and php-pecl-memcached installed. follow my steps and memcached binary installation.


# yum install gcc*
# cd /usr/src
# wget http://pecl.php.net/get/memcache-2.2.5.tgz
# tar zxvf memcache-2.2.5.tgz
# cd memcache-2.2.5
# phpize
# ./configure
# make
# make install

For checking the php.ini file path use following command.


php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

or your php.ini file will be following location


# vim /etc/php.ini

Put following line in that file
extension = “memcache.so”
Restart the apache server

# /etc/init.d/httpd restart

To check is memcache extension loaded in php, execute following command.

#php -i | grep memcache

After restarting the machine memcache need to restart. For that us ( Use this step for only Admin Adserver Box)

# vi /etc/rc.local

Put following contect in to rc.local file (file location – /etc/rc.local)

# memcached -d -p 11211 -u nobody -c 1024 -m 1024

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

One thought on “how to install memcached on centos”

Leave a Reply

Your email address will not be published.