User account menu

  • Log in
BXTra.net

Breadcrumb

  • Home
  • Articles
  • How to install Memcached on CentOS (with DirectAdmin installed) + Memcache PECL

How to install Memcached on CentOS (with DirectAdmin installed) + Memcache PECL

By BXTra | 12:28 AM PDT, Fri April 09, 2010
CentOS
DirectAdmin
Memcached

I just want to try if Memcached can really help my server load or not. So, I look around to find the way how to do it. There are a couple ways but to me, below are what I did to installed it.

Get Libevent which is require to install Memcached. Their homepage is here -> http://www.monkey.org/~provos/libevent/

wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar -xvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure;make;make install;

Then, get Memcached from http://memcached.org

wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
gunzip memcached-1.4.5.tar.gz
tar -xvf memcached-1.4.5.tar
cd memcached-1.4.5
./configure;make;make install;

For me, I got an error below :

error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

So, I did steps below :

nano /etc/ld.so.conf.d/libevent-i386.conf

Then, enter into the textbox

/usr/local/lib/

Then, CTRL+O to save, CTRL+X to exit.

Then, run

 ldconfig

Once you're done with that, try run

memcached -d -u nobody -m 1024 127.0.0.1 -p 11211

This is not done yet, you need to let PHP knows to be able to use memcached.

wget http://pecl.php.net/get/memcache-2.2.5.tgz
gzip -df memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tar
cd memcache-2.2.5
phpize
./configure;make;make install;

Then, edit php.ini file. Add line below into the file

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
extension=memcache.so

Then, restart HTTP and check PHP Status.. You will see Memcached info as below:

Now, you're done install Memcached on the server. However, to really make use of it, you need to modify some code in your website. If you don't. You don't really make use of Memcached.

Server Information - Software
- CentOS 5.4
- DirectAdmin 1.351
- Apache 2.2.15
- PHP 5.2.13
- MySQL 5.1.45

 

Source :
- http://blog.ajohnstone.com/archives/installing-memcached/
- http://alexle.net/archives/275

About text formats
  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Anonymous

15 years ago

Permalink

Hmm, no errors but not installed

Hi, Thanks for the detailed explaination, however, I still can't get this installed. I don't get any errors, just not showing in phpinfo. I think the Direct Admin is really screwing these otherwise simple installs up.
  • Reply

Anonymous

15 years ago

Permalink

Got it working

I managed to get my APC working by using the following lines in php.ini: extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20060613/ extension=apc.so
  • Reply

Anonymous

15 years ago

Permalink

Do the same for memcache also

Make sure memcache appears before APC in php.ini and all will be well with the world.
  • Reply
  • Add new comment

  • Will the router get the Openvpn as a client option?
    6 years ago
  • cancellation
    6 years 1 month ago
  • Router ASUS RT-N12 D1 tomatoes passwort falsch
    7 years 8 months ago
  • WPS button = 30/30/30 hard reset button
    7 years 9 months ago
  • Save my day!
    8 years 3 months ago
  • How to
    8 years 6 months ago
  • Can i still access my modem (the one with the ISP provided)?
    8 years 6 months ago
  • A saving step!
    8 years 10 months ago
  • Problem with Asus n12e-c1
    8 years 11 months ago
  • don't use Hostgator
    9 years 2 months ago

© 2007 - 2023 BXTra.net. All Rights Reserved. 
Certain other content, photos and artwork displayed on BXTra.net are protected by copyright and are the property of their respective owners.

Privacy Policy