<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sohail Riaz, Linux and Open Source Blog &#187; Add new tag</title>
	<atom:link href="http://www.sohailriaz.com/tag/add-new-tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sohailriaz.com</link>
	<description>Sohail Riaz, Linux and Open Source Blog</description>
	<lastBuildDate>Sat, 14 Jan 2012 09:40:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Install memcached with memcache PHP Extension on CentOS 5.x</title>
		<link>http://www.sohailriaz.com/how-to-install-memcached-with-memcache-php-extension-on-centos-5x/</link>
		<comments>http://www.sohailriaz.com/how-to-install-memcached-with-memcache-php-extension-on-centos-5x/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 09:22:18 +0000</pubDate>
		<dc:creator>Sohail Riaz</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://www.sohailriaz.com/?p=209</guid>
		<description><![CDATA[<a href="http://www.sohailriaz.com/how-to-install-memcached-with-memcache-php-extension-on-centos-5x/"><img src=""  alt="" title="" /></a>
In this how to i will describe how to install memcached on your server with PHP Extension.  memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.  My server is running CentOS 5.3 with CPanel.
1) Install memcached.
Enable rpmforge [...]]]></description>
			<content:encoded><![CDATA[<p>In this how to i will describe how to install memcached on your server with PHP Extension.  <a href="http://www.danga.com/memcached/" target="_blank"><strong>memcached </strong></a>is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.  My server is running CentOS 5.3 with CPanel.<span id="more-209"></span></p>
<h3>1) Install memcached.</h3>
<p>Enable rpmforge respository to install latest memcached rpm using yum.</p>
<p>For i386 / i686</p>
<blockquote><p>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm</p></blockquote>
<p>For x86_64</p>
<blockquote><p>rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm</p></blockquote>
<p>Use yum to install memcached</p>
<blockquote><p>yum -y install memcached</p></blockquote>
<p>As soon as memcached installation completed, edit options for memcached in /etc/sysconfig/memcached to meet your need.</p>
<blockquote><p>vi /etc/sysconfig/memcached</p></blockquote>
<blockquote><p>PORT=&#8221;11211&#8243;                #define on which port to urn<br />
USER=&#8221;nobody&#8221;           #same as apache user<br />
MAXCONN=&#8221;1024&#8243;     #maximum number of connections allowed<br />
CACHESIZE=&#8221;64&#8243;         #memory used for caching<br />
OPTIONS=&#8221;"                   #use for any custom options</p></blockquote>
<p>Save the file. All options can be seen by using following command</p>
<blockquote><p>memcached -h</p></blockquote>
<p>Start memcached</p>
<blockquote><p>/etc/init.d/memcached start<br />
Starting Distributed memory caching (memcached):           [  OK  ]</p></blockquote>
<p>to check the running status of memcached</p>
<blockquote><p>/etc/init.d/memcached status<br />
memcached (pid 6475) is running&#8230;</p></blockquote>
<p>and</p>
<blockquote><p>netstat -anp | grep 11211<br />
tcp  0  0 :::11211    :::*  LISTEN      6475/memcached<br />
udp 0  0 0.0.0.0:11211  0.0.0.0:* 6475/memcached</p></blockquote>
<p>2) Install PHP Extension.</p>
<p>Download and install latest stable memcache version from PECL.</p>
<blockquote><p>cd /usr/src<br />
wget http://pecl.php.net/get/memcache-2.2.5.tgz<br />
tar zxvf memcache-2.2.5.tgz<br />
cd memcache-2.2.5<br />
phpize<br />
./configure<br />
make<br />
make install</p></blockquote>
<p>memcache.so will be install in php modules directory, now enable memcache.so extension in php.ini</p>
<p>To find out your php.ini location, execute following command</p>
<blockquote><p>php -i | grep php.ini<br />
Configuration File (php.ini) Path =&gt; /usr/local/lib<br />
Loaded Configuration File =&gt; /usr/local/lib/php.ini</p></blockquote>
<blockquote><p>vi /usr/local/lib/php.ini</p></blockquote>
<blockquote><p>extension = &#8220;memcache.so&#8221;</p></blockquote>
<p>save the file and restart httpd server.</p>
<blockquote><p>/etc/init.d/httpd restart</p></blockquote>
<p>To check is memcache extension loaded in php, execute following command.</p>
<blockquote><p>php -i | grep memcache<br />
memcache<br />
memcache support =&gt; enabled<br />
memcache.allow_failover =&gt; 1 =&gt; 1<br />
memcache.chunk_size =&gt; 8192 =&gt; 8192<br />
memcache.default_port =&gt; 11211 =&gt; 11211<br />
memcache.default_timeout_ms =&gt; 1000 =&gt; 1000<br />
memcache.hash_function =&gt; crc32 =&gt; crc32<br />
memcache.hash_strategy =&gt; standard =&gt; standard<br />
memcache.max_failover_attempts =&gt; 20 =&gt; 20<br />
Registered save handlers =&gt; files user sqlite memcache<br />
PWD =&gt; /usr/src/memcache-2.2.5<br />
_SERVER["PWD"] =&gt; /usr/src/memcache-2.2.5<br />
_ENV["PWD"] =&gt; /usr/src/memcache-2.2.5</p></blockquote>
<p>This information can also be seen using phpinfo().</p>
<p>If you have question please comment.</p>
<img src="http://www.sohailriaz.com/wp-content/plugins/pixelstats/trackingpixel.php?post_id=209&amp;ts=1328437571" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.sohailriaz.com/how-to-install-memcached-with-memcache-php-extension-on-centos-5x/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

