<?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>Bit Matrix &#187; php</title>
	<atom:link href="http://blog.bit-matrix.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bit-matrix.com</link>
	<description>Tech. Code. Linux. MySQL. Ones. Zeroes.</description>
	<lastBuildDate>Tue, 31 Aug 2010 01:10:39 +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 PHP 5.2 on CentOS 5</title>
		<link>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/</link>
		<comments>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:43:16 +0000</pubDate>
		<dc:creator>Bit Matrix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[pecl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php 5.2]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://blog.bit-matrix.com/?p=66</guid>
		<description><![CDATA[I recently needed to install PHP 5.2 on CentOS 5.3. This version of CentOS comes with PHP 5.1 but, in order to run phpMyAdmin, I needed 5.2. The CentOS software repositories are, unfortunately, still stuck with 5.1 and the only way to get a newer version of PHP installed via the package manager (yum) is [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed to install PHP 5.2 on CentOS 5.3. This version of CentOS comes with PHP 5.1 but, in order to run phpMyAdmin, I needed 5.2. The CentOS software repositories are, unfortunately, still stuck with 5.1 and the only way to get a newer version of PHP installed via the package manager (yum) is to add another repository that has a newer version.<span id="more-66"></span></p>
<p>For this we will use the CentOS testing repository:<br />
<code><br />
cd /etc/yum.repos.d/<br />
sudo wget http://dev.centos.org/centos/5/CentOS-Testing.repo<br />
sudo rpm --import http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing<br />
</code></p>
<p>Now we can fetch package information about PHP using the new repository:<br />
<code><br />
yum --enablerepo=c5-testing info php<br />
</code></p>
<p>Check the version number. If it is what you need you can go ahead and install it using yum:<br />
<code><br />
sudo  yum --enablerepo=c5-testing update php<br />
</code></p>
<p>Assuming that worked, you can now restart Apache and be on your way:<br />
<code><br />
sudo /etc/init.d/httpd restart<br />
</code></p>
<h4>Memcache</h4>
<p>If, like me, you were using memcache you might run into a problem where memcache never got updated to the proper version because it did not exist in the CentOS testing repository. The memcache module on the system ends up with a different PHP API version than is required by the new version of PHP you just installed.</p>
<p>Upon starting PHP you might see a warning similar to this:<br />
<code><br />
Module compiled with API 20040429<br />
PHP compiled with API 20060613<br />
</code></p>
<p>Again, we will add a new repository from <a href="http://blog.famillecollet.com/pages/Config-en">Remi Collet</a>. The steps should be as follows:<br />
<code><br />
cd /etc/yum.repos.d/<br />
wget http://rpms.famillecollet.com/remi-enterprise.repo<br />
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm<br />
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm<br />
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm<br />
</code></p>
<p>Now we can install the newest memcache library:<br />
<code><br />
sudo yum --enablerepo=remi install libmemcached\*<br />
</code></p>
<p>Build the PHP module using Pecl (you might have to install php-devel packages for this):<br />
<code><br />
pecl install memcache<br />
</code></p>
<p>Edit /etc/php.d/memcache.ini and add:<br />
<code><br />
extension=memcache.so<br />
</code></p>
<p>Restart Apache:<br />
<code><br />
sudo /etc/init.d/httpd restart<br />
</code></p>
<p>With a little bit of luck you will now have PHP 5.2.x and Memcache!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bit-matrix.com/2009/10/22/how-to-install-php-52-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
