Articles


Install Memcached Php Extension CentOS 5 And 6

Install Memcached Php Extension CentOS 5 And 6



Posted bynitheesh,2nd May 2016

Memcached is a memory-based object storage. Memcached is a general-purpose distributed memory caching system. It is originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source must be read. Memcached runs on Unix, Linux, Windows and Mac OS X and is distributed under a permissive free software license.

Features

  • Flexible data model
  • Easy scalability
  • Consistent high performance
  • Always on 24x365

Install Memcached

pecl install memcached

extension = "memcache.so"

Then restart the web server to load php extension again:

/etc/init.d/httpd restart

Installing manually

There are times when Pecl will not work, probably due to /tmp/ direct doesn’t have enough permission to compile the extension.

Automatic install doesn’t work, install manually:

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
extension = "memcache.so"
php -i | grep php.ini

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

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

Then restart the web server to load php extension again:

/etc/init.d/httpd restart