<?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>The Netocracy &#187; MySQL</title>
	<atom:link href="http://www.thenetocracy.com/tags/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thenetocracy.com</link>
	<description>Liberty Prime is go</description>
	<lastBuildDate>Mon, 21 Dec 2009 07:01:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing PHP 5.3 on Mac OS X Leopard</title>
		<link>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/</link>
		<comments>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 03:20:24 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5.3]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.thenetocracy.com/?p=5</guid>
		<description><![CDATA[After many frustrating hours and three separate attempts I am finally running PHP 5.3.0alpha3 on my MacBook Pro using the default Leopard Apache installation (the one you can turn on/off with web sharing). This post is as much a summary &#8230; <a href="http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After many frustrating hours and <em>three</em> separate attempts I am finally running PHP 5.3.0alpha3 on my MacBook Pro using the default Leopard Apache installation (the one you can turn on/off with web sharing). This post is as much a summary for my own records as it is how-to to people in the same boat. I&#8217;d like to point out that I&#8217;m not very experienced with compiling software from source, and for some reason I was determined to utilise the default Leopard installation of Apache.</p>
<p>The problem with the whole process was the Apple compiled version of Apache runs at 64Bit, and at present it&#8217;s not possible to compile the  PHP 5.3 Apache module to be compatible. The solution is to cut the Apache binary back to run at 32Bit. That can be done quite simply and is explained by Tony Bibbs back in June with <a title="PHP 5.3 on Mac OS X 10.5" href="http://www.tonybibbs.com/article.php/PHP-5_3-on-10.5">PHP 5.3 on Mac OS X 10.5</a>.</p>
<p>Once you&#8217;ve cut Apache back to 32Bit, you just need to install MySQL.<em> Before I read Tony&#8217;s post I went to all the effort of compiling MySQL 5.1RC in 64Bit, then found out that PHP wasn&#8217;t compatible with the 64bit. </em>Installing a released version of MySQL is simple, and in my opinion not worth going through the effort of compiling from source (unless you need some special functionality). I just took the latest release from the <a title="Mysql Download" href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg">MySQL download site</a> and installed it (<em>after removing numerious other versions first, see below</em>).</p>
<p>After MySQL was running, I downloaded the latest snapshot of PHP 5.3 from <a href="http://snaps.php.net/">snaps.php.net</a> , extracted, then ran the following configure command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53 \
<span style="color: #660033;">--with-apxs2</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>apxs <span style="color: #660033;">--with-config-file-scan-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53<span style="color: #000000; font-weight: bold;">/</span>php.d \
<span style="color: #660033;">--with-iconv</span> <span style="color: #660033;">--with-openssl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-ftp</span> <span style="color: #660033;">--enable-sockets</span> \
<span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-calendar</span> <span style="color: #660033;">--enable-bcmath</span> \
<span style="color: #660033;">--with-curl</span>=shared,<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>php53 <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr  \
<span style="color: #660033;">--with-mysqli</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql_config</pre></div></div>

<p>Note my use of &#8211;prefix=/usr/local/php53 &#8211; this was my choice, as I didn&#8217;t want it to potentially overwrite my php 5.2 installation that was there.</p>
<p>The important elements here are &#8211;prefix and &#8211;with-mysqli</p>
<p>Also &#8211; I&#8217;m not 100% on what &#8211;with-config-file-scan-dir does, but it caused no problems.</p>
<p>After configure succeeds I ran</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>Then after a cofee/beer I ran</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>From what I could gather, the install procedure created the libphp5.so file inside the /libexec/apache2/ directory (overwriting the one that was previously there), and also added the &#8216;loadModule&#8217; line within the apache config file @ /private/etc/apache2/httpd.conf. If I did this again, I would backup previous php libraries.</p>
<p>Finally, a sudo apachectl restart restarts the apache server and I was on my way.</p>
<p><strong>Footnotes: </strong></p>
<p>Here&#8217;s some locations I found useful</p>
<p>Apache&#8217;s Httpd.conf is @ /private/etc/apache2/httpd.conf</p>
<p>The APXS libraries are @ /usr/sbin/apxs</p>
<p>PHP &#038; MySQL (by default) install to /usr/local/</p>
<p><strong>MySQL</strong></p>
<p>Throughout this whole trial and error process, I think I installed MySQL about three different times. Before finally just downloading the latest 5.0 release I took some steps to remove the previous installations. If you&#8217;ve installed MySQL many times (like I did) and you&#8217;re a bit conscious about having junk all over the place then best place to start looking for information on what&#8217;s installed where is the <strong>Readme.txt</strong> file that comes with the OS X package installer,  and also the <a href="http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html">Mysql Installation notes for OS X</a>.  </p>
<p>An article I found that also helped me search for some lost MySQL installs, and shed some light on what to do was this post titled <a title="Removing / Uninstalling MySQL" href="http://lee.hambley.name/archives/31">Removing MySql &#8211; by Lee Hambly</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenetocracy.com/2008/10/06/installing-php-53-on-mac-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
