<?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>Narkaleptic Thoughtless &#187; php 6</title>
	<atom:link href="http://josh.mainelan.net/tag/php-6/feed/" rel="self" type="application/rss+xml" />
	<link>http://josh.mainelan.net</link>
	<description>Random nonsense from the mind of Narkaleptic.</description>
	<lastBuildDate>Wed, 02 Sep 2009 18:29:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing PHP 6 on CentOS 5</title>
		<link>http://josh.mainelan.net/2009/06/installing-php-6-on-centos-5/</link>
		<comments>http://josh.mainelan.net/2009/06/installing-php-6-on-centos-5/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 12:45:28 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[icu]]></category>
		<category><![CDATA[libxml2]]></category>
		<category><![CDATA[php 6]]></category>
		<category><![CDATA[php6]]></category>

		<guid isPermaLink="false">http://josh.mainelan.net/?p=61</guid>
		<description><![CDATA[How I installed PHP 6 along side PHP 5.2 on my CentOS 5 VPS web server.]]></description>
			<content:encoded><![CDATA[<p>I started playing in PHP 5.3 with <a href="http://www.zend.com">Zend</a>&#8217;s Early Access 7.0 <a href="http://www.zend.com/en/products/studio/studio-7-early-access">Studio</a> and <a href="http://www.zend.com/en/products/server/downloads-ea">Server CE</a> and wanted to put it on my web server.  Problem: It isn&#8217;t released yet and the library name is &#8220;php5&#8243;, same as PHP 5.2.  I didn&#8217;t want to replace my production-ready PHP installation with a release candidate.  I&#8217;m sure that would make my clients happy about unknown security holes, yadda yadda.  The only solution is to install PHP 6 and enable it by virtual domain or directory.  Please note that it is entirely possible to install PHP 5.3 along side PHP 5.2.9 using the first as CGI, but I want to avoid the confusion.</p>
<p>My CentOS 5 64-bit server is a <a href="http://en.wikipedia.org/wiki/Virtual_private_server">VPS</a> from <a href="http://order.1and1.com/xml/order/VpsRoot">1&#038;1</a>.</p>
<p><strong>Final notes</strong> before we get started.  I did a &#8220;yum update&#8221; to bring my system to the latest everything.  And no, installing libxml2 or icu via yum won&#8217;t help you.  You can skip the gmake test, it is 7180 individual tests that can take a LOT of time on slower servers.  CentOS is based on RedHat, so this will likely work with it as well.</p>
<p><code><br />
# install the stuff you need to compile</p>
<p>yum install gcc gcc-c++.x86_64<br />
yum install mysql-devel.x86_64 libpng-devel.x86_64 libjpeg-devel.x86_64</p>
<p># compile and install icu where php6 can find it</p>
<p>mkdir /usr/local/icu<br />
wget ftp://ftp.software.ibm.com/software/globalization/icu/3.6/icu4c-3_6-src.tgz<br />
tar xkmfz icu4c-3_6-src.tgz<br />
cd icu/source<br />
./configure --prefix=/usr/local/icu<br />
gmake<br />
gmake install<br />
cd ../..</p>
<p># compile and install icu where php6 can find it</p>
<p>mkdir /usr/local/libxml2<br />
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz<br />
tar xkmfz libxml2-2.7.3.tar.gz<br />
cd libxml2-2.7.3<br />
autoreconf<br />
./configure --prefix=/usr/local/libxml2<br />
gmake<br />
gmake install<br />
cd ..</p>
<p># compile php6 from http://snaps.php.net<br />
# with libxml2, GD (jpeg + png) and MySQL</p>
<p># make the config path<br />
mkdir /etc/php6<br />
mkdir /etc/php6.d</p>
<p># download and extract the latest path, get it from snaps.php.net<br />
wget http://snaps.php.net/php6.0-############<br />
tar xkmfz php6.0-############<br />
cd ~/php6.0-############</p>
<p># refresh the conf<br />
autoconf</p>
<p># paste in this entire block and press enter:<br />
./configure \<br />
 --prefix=/usr/local/php6 \<br />
 --with-config-file-path=/etc/php6 \<br />
 --with-config-file-scan-dir=/etc/php6.d \<br />
 --with-icu-dir=/usr/local/icu \<br />
 --with-libxml-dir=/usr/local/libxml2 \<br />
 --with-gd \<br />
 --with-jpeg-dir=/usr/lib64 \<br />
 --with-png-dir=/usr/lib64 \<br />
 --with-zlib-dir=/usr/lib64 \<br />
 --with-mysql=mysqlnd \<br />
 --with-mysqli=mysqlnd \<br />
 --with-pdo-mysql=mysqlnd \<br />
 --with-mysql-sock=/var/lib/mysql/mysql.sock</p>
<p># alt for mysqli:  --with-mysqli=/usr/bin/mysql_config</p>
<p># compile and install.  you can skip test if you want.<br />
gmake<br />
gmake test<br />
gmake install</p>
<p># prepare configuration<br />
cp php.ini-* /etc/php6</p>
<p># and ONE of the following to set up your php.ini</p>
<p># if you plan to host pages to the outside world<br />
cp php.ini-production /etc/php6/php.ini</p>
<p># if you plan to use this installation as a test site for development<br />
cp php.ini-development /etc/php6 php.ini</p>
<p># if you have issues with mysql:<br />
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock</p>
<p></code></p>
<p>Oh yeah, and <strong>running along side PHP 5</strong>?  Toss something like this in a new file: /etc/httpd/conf.d/php6.conf</p>
<p><code><br />
        ScriptAlias /php6-cgi /usr/local/php6/bin/php-cgi<br />
        Action application/x-http-php6 /php6-cgi<br />
        AddHandler application/x-http-php6 .php6<br />
</code></p>
<p>Now anything .php6 will run php6 as cgi.  If you have problems with CGI or MySQL, try nixing SuExec first.  If you want to use it, you&#8217;ll need to be recompile it with a special folder permission for PHP 6.</p>
]]></content:encoded>
			<wfw:commentRss>http://josh.mainelan.net/2009/06/installing-php-6-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
