<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[CentOS - All your code are belong to us]]></title><description><![CDATA[Thoughts, stories and ideas on code and technology in general.<br>Blog title inspired by <a href="https://en.wikipedia.org/wiki/All_your_base_are_belong_to_us" target="_blank">this meme</a>]]></description><link>https://allurcode.com/</link><image><url>https://allurcode.com/favicon.png</url><title>CentOS - All your code are belong to us</title><link>https://allurcode.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Sun, 22 Mar 2026 11:27:56 GMT</lastBuildDate><atom:link href="https://allurcode.com/tag/centos/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[How to run memcache in PHP]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>After installing <a href="https://allurcode.com/how-to-install-memcached-on-centos/"><strong>memcached</strong></a> daemon, we have to install memcache PHP extension.</p>
<pre><code class="language-bash">yum install php-pecl-memcache
</code></pre>
<p>or</p>
<pre><code class="language-bash">apt-get install php5-memcache
</code></pre>
<p>If above is not an option try below method.</p>
<pre><code class="language-bash">pecl install memcache
</code></pre>
<p>After successful installation add <code>memcache.so</code> extension to your <code>php.ini</code> file.</p>
<pre><code class="language-bash">vim /etc/php.ini
</code></pre>
<p>Add this line:</p>
<pre><code>extension=</code></pre>]]></description><link>https://allurcode.com/how-to-run-memcache-in-php/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea11a</guid><category><![CDATA[CentOS]]></category><category><![CDATA[Linux]]></category><category><![CDATA[memcache]]></category><category><![CDATA[PHP]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Sat, 13 Mar 2010 01:51:11 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>After installing <a href="https://allurcode.com/how-to-install-memcached-on-centos/"><strong>memcached</strong></a> daemon, we have to install memcache PHP extension.</p>
<pre><code class="language-bash">yum install php-pecl-memcache
</code></pre>
<p>or</p>
<pre><code class="language-bash">apt-get install php5-memcache
</code></pre>
<p>If above is not an option try below method.</p>
<pre><code class="language-bash">pecl install memcache
</code></pre>
<p>After successful installation add <code>memcache.so</code> extension to your <code>php.ini</code> file.</p>
<pre><code class="language-bash">vim /etc/php.ini
</code></pre>
<p>Add this line:</p>
<pre><code>extension=memcache.so
</code></pre>
<p>Restart web server</p>
<pre><code class="language-bash">service httpd restart
</code></pre>
<p>Test out our installation.</p>
<pre><code class="language-bash">&lt;?php
$memcache = new Memcache;
$memcache-&gt;connect(&apos;localhost&apos;, 11211) or die (&apos;Can\&apos;t connect!&apos;);
$version = $memcache-&gt;getVersion();
echo &apos;Server version: &apos;.$version;
</code></pre>
<p>You should see your server&#x2019;s version number. If you see a blank page make sure that <a href="https://allurcode.com/how-to-install-memcached-on-centos/">memcached</a> daemon is working. If you&#x2019;re getting &quot;Can&#x2019;t connect!&quot; message despite running daemon try changing &apos;localhost&apos; to &apos;127.0.0.1&apos;.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How to install memcached on CentOS]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="installdependancy">Install dependancy</h3>
<p>Before we install <strong>memcached</strong> we need a dependency library <strong>libevent</strong>. Check for latest stable version at <a href="https://monkey.org/~provos/libevent/">https://monkey.org/~provos/libevent/</a></p>
<pre><code class="language-bash">cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar -xzvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure --prefix=</code></pre>]]></description><link>https://allurcode.com/how-to-install-memcached-on-centos/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea119</guid><category><![CDATA[bash]]></category><category><![CDATA[CentOS]]></category><category><![CDATA[libevent]]></category><category><![CDATA[Linux]]></category><category><![CDATA[memcached]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Sat, 13 Mar 2010 01:28:50 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="installdependancy">Install dependancy</h3>
<p>Before we install <strong>memcached</strong> we need a dependency library <strong>libevent</strong>. Check for latest stable version at <a href="https://monkey.org/~provos/libevent/">https://monkey.org/~provos/libevent/</a></p>
<pre><code class="language-bash">cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar -xzvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure --prefix=/usr/local
make
make install
cd ..
</code></pre>
<h3 id="installmemcached">Install memcached</h3>
<p>Check for latest stable version at <a href="https://memcached.org/">https://memcached.org/</a></p>
<pre><code class="language-bash">wget http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
tar -xzvf memcached-1.4.4.tar.gz
cd memcached-1.4.4
LDFLAGS=&apos;-Wl,--rpath /usr/local/lib&apos;
./configure --prefix=/usr/local
make
make install
</code></pre>
<p>More information about LDFLAGS <a href="https://en.wikipedia.org/wiki/Linker">https://en.wikipedia.org/wiki/Linker</a></p>
<h3 id="runmemcachedasadaemon">Run memcached as a daemon</h3>
<p>Basic options: d = daemon, m = memory, u = user, l = IP to listen to, p = port</p>
<pre><code class="language-bash">memcached -u root -d
</code></pre>
<p>or</p>
<pre><code class="language-bash">memcached -u root -d -m 512 -l 127.0.0.1 -p 11211
</code></pre>
<p>To stop daemon type</p>
<pre><code class="language-bash">pkill memcached
</code></pre>
<p>Now we&#x2019;re off to installing <a href="https://allurcode.com/how-to-run-memcache-in-php/">php extension memcache</a>.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[yum Missing Dependency]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="problem">Problem</h2>
<p>Sometimes after running <code>yum update</code> or <code>yum install something</code> you&#x2019;re getting missing dependency error messages. Like this:</p>
<pre><code class="language-bash">--&gt; Missing Dependency: /usr/lib64/python2.4 is needed by package gamin-python-0.1.7-8.el5.x86_64 (installed)
--&gt; Missing Dependency: /usr/lib64/python2.4 is needed by</code></pre>]]></description><link>https://allurcode.com/yum-missing-dependency/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea117</guid><category><![CDATA[CentOS]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Thu, 20 Aug 2009 14:45:07 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="problem">Problem</h2>
<p>Sometimes after running <code>yum update</code> or <code>yum install something</code> you&#x2019;re getting missing dependency error messages. Like this:</p>
<pre><code class="language-bash">--&gt; Missing Dependency: /usr/lib64/python2.4 is needed by package gamin-python-0.1.7-8.el5.x86_64 (installed)
--&gt; Missing Dependency: /usr/lib64/python2.4 is needed by package libxml2-python-2.6.26-2.1.2.8.x86_64 (installed)
</code></pre>
<p>This means that some other package needs to be installed in order to install the one you want. If you have all dependencies installed and you&#x2019;re still getting those messages all you need to do is clean yum&#x2019;s cache.</p>
<h2 id="solution">Solution</h2>
<p>Run one of these (taken from yum manual):</p>
<p>The following are the ways which you can invoke yum in clean mode. Note that &quot;all files&quot; in the commands below means &quot;all files in currently enabled repositories&quot;. If you want to also clean any (temporarily) disabled repositories you need to use <code>&#x2013;enablerepo=&apos;*&apos;</code> option.</p>
<pre><code class="language-bash">yum clean packages
</code></pre>
<p>Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are downloaded.</p>
<pre><code class="language-bash">yum clean headers
</code></pre>
<p>Eliminate all of the header files which yum uses for dependency resolution.</p>
<pre><code class="language-bash">yum clean metadata
</code></pre>
<p>Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the metadata the next time it is run.</p>
<pre><code class="language-bash">yum clean dbcache
</code></pre>
<p>Eliminate the sqlite cache used for faster access to metadata. Using this option will force yum to recreate cache next time it is run.</p>
<pre><code class="language-bash">yum clean all
</code></pre>
<p>Runs <code>yum clean packages</code> and <code>yum clean headers</code>, <code>yum clean metadata</code> and <code>yum clean dbcache</code> as above.</p>
<p>Now run again your <code>yum update</code> or any other <code>yum install</code> command and it should be fine.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>