Thursday, November 8, 2012

Memcached - Install memcache in ubuntu

Install memcached
sudo aptitude install memcached

Change configuration of memcached
vi /etc/memcached.conf

--- Show file and change configuration
# Memory a usage in Mb
-m 16  
# default port  
-p 11211  
# user to run daemon nobody/apache/www-data or else 
-u nobody  
# only listen locally  
-l 127.0.0.1

Restart memcached
sudo /etc/init.d/memcached restart

If memcached not start please run this code 
memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211

Install php with memcached
sudo aptitude install php5-memcached
sudo apt-get install php5-memcache

Restart memcached PHP 
sudo /etc/init.d/memcached restart
sudo /etc/init.d/apache2 restart

No comments:

Post a Comment