Dan Paul Smith

Interface and visualisation developer.

Saturday 12 March 2011

Installing memcache on Ubuntu 10.04

Another Linux guide, simply because I had to use a mixture of guides to get memcache working for me.

I need memcache to use Puelia (a PHP implementation of the Linked Data API).

sudo apt-get install memcached
sudo apt-get install php-pear
sudo apt-get install php5-dev
sudo apt-get install libmemcached-dev
sudo pecl install Memcache
sudo echo "extension=memcache.so" > /etc/php5/apache2/conf.d/memcache.ini


Find your php.ini file, mine was here - /etc/php5/apache2/php.ini, add this line to the bottom of the file:

memcache.hash_strategy="consistent"

Try this:

memcached -d -m 1024 -l 127.0.0.1 -p 11211

If you get a message saying, "can't run as root without -u switch" then try this:

memcached -d -u www-data -m 1024 -l 127.0.0.1 -p 11211

service apache2 restart

Voila.

2 comments:

dinesh kumar said...

Thanks.... :-)

Muqtasidmansoor said...

Wow, thanks a lot!