As most developers know memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.

Memcached Defination:

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Installing Memcached in your server:

# yum install memcached

Configure Memcached:

# nano -w /etc/sysconfig/memcached

The values I normally use (depending on what the server is for):

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""

Set Memcached to start automatically on boot:

# chkconfig memcached on

Start Memcached:

# /etc/init.d/memcached start

Install PHP memcache Module:
First, make sure you have all needed libraries on the server so the installation is quick and free of issues.

# yum install php-devel
# yum install zlib-devel

Once those libraries are on the server lets use PECL to download and install memcache from repository:

# pecl install memcache

To enable the PHP extension you should edit your php.ini configuration file and add this to the end of the file:

extension = memcache.so

Restart Apache

# /etc/ini.d/httpd restart

You can check that you have successfully installed memcache via phpinfo().
Go to your HTTP directory

# cd /var/www/html/

Create and edit the file

# nano info.php

Paste the following lines:

<?php phpinfo(); ?>

Hit Control+X, nano will ask if you want to save the changes hit Y and hit Enter
Browse to your HTTP directory and run the file http://localhost/info.php

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

Cheap Oakley Sunglasses Fifa Coins Fifa Coins Cheap Fifa Coins buy cheap fifa coins buy fifa coins cheap fifa coins fifa coins sale Fifa Coins cheap fifa coins sale fifa coins for sale cheap fifa coins price