<?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; centos 5</title>
	<atom:link href="http://josh.mainelan.net/tag/centos-5/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>Install PHP 5.3.0 on CentOS 5 as CGI along side PHP 5.2.9</title>
		<link>http://josh.mainelan.net/2009/06/php-5-3-on-centos-5-as-cgi/</link>
		<comments>http://josh.mainelan.net/2009/06/php-5-3-on-centos-5-as-cgi/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 23:37:35 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[php 5.3]]></category>

		<guid isPermaLink="false">http://josh.mainelan.net/?p=74</guid>
		<description><![CDATA[Well, turns out I&#8217;d rather play with just PHP 5.3 RC4 for now.  Here is my guide to installing it onto my CentOS 5 64-bit VPS from 1&#038;1.

Update: PHP 5.3.0 has been released and there are some changes.

It went pretty smoothly.  Here is the guide, minus the hours of trial and error, of [...]]]></description>
			<content:encoded><![CDATA[<p>Well, turns out I&#8217;d rather play with just PHP 5.3 RC4 for now.  Here is my guide to installing it onto my CentOS 5 64-bit <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>.<br />
<br />
<strong>Update:</strong> PHP 5.3.0 has been released and there are some changes.<br />
<br />
It went pretty smoothly.  Here is the guide, minus the hours of trial and error, of course:<br />
<br />
<strong>First</strong>, install anything you may need to compile with.<br />
<code><br />
yum install gcc gcc-c++.x86_64</p>
<p>yum install \<br />
&nbsp;	libicu-devel.x86_64 \<br />
&nbsp;	libxml2-devel.x86_64 \<br />
&nbsp;	mysql-devel.x86_64 \<br />
&nbsp;	libpng-devel.x86_64 \<br />
&nbsp;	libjpeg-devel.x86_64 \<br />
&nbsp;	curl-devel.x86_64 \<br />
&nbsp;	bzip2-devel.x86_64 \<br />
&nbsp;	gettext-devel.x86_64 \<br />
&nbsp;	gmp-devel.x86_64 \<br />
&nbsp;	pcre-devel.x86_64 \<br />
&nbsp;	freetype-devel.x86_64 \<br />
&nbsp;	gd-devel.x86_64 \<br />
&nbsp;	aspell-devel.x86_64<br />
</code><br />
<strong>NOTE:</strong> You can copy that entire block and paste it, the backslash (\) will carry the command over to the next line automatically.</p>
<p><strong>Next</strong>, make the folders for the configs and binaries.<br />
<code><br />
mkdir /usr/local/php53 /etc/php53 /etc/php53.d<br />
</code><br />
<br />
<strong>Begin</strong>, by downloading and extracting the latest snapshot.  Don&#8217;t use the file name I have below, get it fresh from <a href="http://snaps.php.net"> snaps.php.net</a>.<br />
<code><br />
cd ~<br />
wget http://us2.php.net/get/php-5.3.0.tar.bz2/from/us.php.net/mirror<br />
tar xjf php-5.3.0.tar.bz2<br />
cd php-5.3.0.tar.bz2</p>
<p># gz: tar xzf php-5.3.0.tar.gz<br />
# bz2: tar xfj php-5.3.0.tar.bz2<br />
# zip: tar xfZ php-5.3.0.zip</code><br />
<br />
<strong>Now</strong>, set up all of your configuration options.  You may want to adjust these.  To see what they mean, type: <code>./configure --help</code><br />
<code><br />
./configure \<br />
&nbsp;	--prefix=/usr/local/php53  \<br />
&nbsp;	--with-libdir=lib64  \<br />
&nbsp;	--with-config-file-path=/etc/php53  \<br />
&nbsp;	--with-config-file-scan-dir=/etc/php53.d  \<br />
&nbsp;	--with-bz2  \<br />
&nbsp;	--with-curl  \<br />
&nbsp;	--with-exec-dir=/usr/bin  \<br />
&nbsp;	--with-freetype-dir=/usr  \<br />
&nbsp;	--with-png-dir=/usr  \<br />
&nbsp;	--enable-gd-native-ttf  \<br />
&nbsp;	--without-gdbm  \<br />
&nbsp;	--with-gettext  \<br />
&nbsp;	--with-gmp  \<br />
&nbsp;	--with-iconv  \<br />
&nbsp;	--with-jpeg-dir=/usr  \<br />
&nbsp;	--with-openssl  \<br />
&nbsp;	--with-png-dir=/usr \<br />
&nbsp;	--with-pspell  \<br />
&nbsp;	--with-libexpat-dir=/usr  \<br />
&nbsp;	--with-pcre-regex=/usr  \<br />
&nbsp;	--with-zlib  \<br />
&nbsp;	--with-layout=GNU  \<br />
&nbsp;	--enable-exif  \<br />
&nbsp;	--enable-ftp  \<br />
&nbsp;	--enable-magic-quotes  \<br />
&nbsp;	--enable-sockets  \<br />
&nbsp;	--enable-sysvsem  \<br />
&nbsp;	--enable-sysvshm  \<br />
&nbsp;	--enable-sysvmsg  \<br />
&nbsp;	--enable-wddx  \<br />
&nbsp;	--with-kerberos  \<br />
&nbsp;	--enable-ucd-snmp-hack  \<br />
&nbsp;	--enable-shmop  \<br />
&nbsp;	--enable-calendar  \<br />
&nbsp;	--with-mysql=mysqlnd \<br />
&nbsp;	--with-mysqli=mysqlnd \<br />
&nbsp;	--with-pdo-mysql=mysqlnd \<br />
&nbsp;	--with-mysql-sock=/var/lib/mysql/mysql.sock \<br />
&nbsp;	--with-libxml-dir=/usr  \<br />
&nbsp;	--without-mysql  \<br />
&nbsp;	--with-gd=/usr<br />
</code><br />
<br />
<strong>Finally</strong>, compile and install!<br />
<code><br />
gmake<br />
gmake install<br />
</code><br />
<br />
<strong>Lastly</strong>, you&#8217;ll likely want to use it in Apache&#8230;  Here is how I set up my domain to use PHP 5.3:<br />
<code><br />
&lt;VirtualHost 74.208.46.111:80&gt;<br />
&nbsp;    ServerName php53.mainelan.com:80<br />
&nbsp;    ServerAlias www.php53.mainelan.com<br />
&nbsp;    UseCanonicalName On<br />
&nbsp;    ServerAdmin "webmaster@mainelan.net"<br />
&nbsp;    DocumentRoot /var/www/vhosts/php53.mainelan.com/httpdocs</p>
<p><strong>&nbsp;    # PHP 5.3<br />
&nbsp;    ScriptAlias    /php53-cgi /usr/local/php53/bin/php-cgi<br />
&nbsp;    Action         application/x-http-php53 /php53-cgi<br />
&nbsp;    AddHandler   application/x-http-php53 .php</strong></p>
<p>&nbsp; . . .<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://josh.mainelan.net/2009/06/php-5-3-on-centos-5-as-cgi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>
