<?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>Westbright &#187; webdev</title>
	<atom:link href="http://www.westbright.com/blog/tag/webdev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.westbright.com/blog</link>
	<description>A blog about developing software by Matt West.</description>
	<lastBuildDate>Wed, 04 Nov 2009 23:47:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fixing PHP PDO after Mac OS X Update</title>
		<link>http://www.westbright.com/blog/2008/06/fixing-php-pdo-after-mac-os-x-update/</link>
		<comments>http://www.westbright.com/blog/2008/06/fixing-php-pdo-after-mac-os-x-update/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 17:10:52 +0000</pubDate>
		<dc:creator>mattwestbright</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.westbright.com/blog/?p=8</guid>
		<description><![CDATA[
	A Mac is set up to do web development out of the box, but I decided to build PHP 5 and MySQL 5 from source for a number of reasons. I prefer to use PHP&#8217;s PDO wrapper in my data access layer, not those database specific mysql_* functions. So I followed the instructions at HiveLogic [...]]]></description>
			<content:encoded><![CDATA[<p>
	A Mac is set up to do web development out of the box, but I decided to build <a href="http://www.php.net/downloads.php">PHP 5</a> and <a href="http://dev.mysql.com/downloads/mysql/5.0.html#downloads">MySQL 5</a> from source for a number of reasons. I prefer to use PHP&#8217;s <a href="http://www.php.net/pdo">PDO</a> wrapper in my data access layer, not those database specific <code>mysql_*</code> functions. So I followed the instructions at <a href="http://hivelogic.com/articles/2007/02/ruby-rails-mongrel-mysql-osx">HiveLogic</a> <a href="http://www.procata.com/blog/archives/2007/10/28/working-with-php-5-in-mac-os-x-105/">and</a> <a href="http://www.456bereastreet.com/archive/200711/virtual_hosts_php_and_mysql_on_mac_os_x_105_leopard/">others</a>.
</p>
<p>But when I updated my Mac OS X to 10.5.3 I lost the MySQL PDO configuration. This had also happened when I installed previous 10.5 updates. Fortunately I had kept my configuration in a script. So if you too want to re-configure the PHP PDO for MySQL on your Mac, here is what to do.</p>
<p>Open terminal and <code>cd</code> to you php directory. then run <code>configure</code>:</p>
<pre>
	'./configure' \
	'--prefix=/Users/matt/php' '--with-xsl=/usr' \
	'--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' \
	'--with-kerberos=/usr' '--enable-cli' \
	'--with-zlib-dir=/usr' '--enable-trans-sid' \
	'--with-xml' '--enable-exif' '--enable-ftp' \
	'--enable-mbstring' '--enable-mbregex' \
	'--enable-dbx' '--enable-sockets' \
	'--with-iodbc=/usr' '--with-curl=/usr' \
	'--with-config-file-path=/etc' \
	'--sysconfdir=/private/etc' \
	'--with-pdo' \
	'--with-pdo-mysql=/usr/local/mysql/bin/mysql_config' \
	'--with-mysql=/usr/local/mysql' \
	'--with-mysql-sock=/tmp/mysql.sock' \
	'--with-openssl' '--with-xmlrpc' \
	'--without-pear' \
	'--with-soap'
</pre>
<p>	You might want to put that mouthful in a shell script and call it something witty like <code>config-php-pdo.sh</code>. Now run:
</p>
<pre>
	make
</pre>
<p>	then:</p>
<pre>
	sudo make install
</pre>
<p>	Now you should be able to restart apache (from either the command line or from System Preferences &gt; Sharing panel) but that has not worked for me. I had to restart the OS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westbright.com/blog/2008/06/fixing-php-pdo-after-mac-os-x-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
