<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: MySQL and PDO on OS X Leopard, Intel</title>
	<atom:link href="http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/feed/" rel="self" type="application/rss+xml" />
	<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/</link>
	<description></description>
	<pubDate>Fri, 21 Nov 2008 02:08:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: SeanG</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-19882</link>
		<dc:creator>SeanG</dc:creator>
		<pubDate>Fri, 14 Nov 2008 04:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-19882</guid>
		<description>THANKS! Worked out great!</description>
		<content:encoded><![CDATA[<p>THANKS! Worked out great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Prall</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-19827</link>
		<dc:creator>Adam Prall</dc:creator>
		<pubDate>Thu, 06 Nov 2008 01:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-19827</guid>
		<description>Hey Raz (any anyone else with that same problem), I ended up with the same situation here on an Intel machine, the reason for me was that that computer's enter LAMP setup (Mac OS 10.5, Apache 2, MySQL 5, PHP 5, nothing to do with the commercial “MAMP” package) is 64-bit. And, I had an old pdo_mysql.so module which was compiled against the wrong version of MySQL. So my solution was to follow the above compiling instructions, but modify the config command:

&lt;code&gt;
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS='-O3 -fno-common  -arch x86_64' LDFLAGS='-O3 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch x86_64' \
./configure --prefix=/usr --with-pdo-mysql=/usr/local/mysql
&lt;/code&gt;

…basically, I removed the 32-bit Intel directives, the PowerPC directives, and also made sure that my MySQL path was correct. For example, a port install of MySQL, and including PowerPC and Intel 32 bit versions might be:

&lt;code&gt;
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' LDFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \
./configure --prefix=/usr --with-pdo-mysql=/opt/local/lib/mysql5/mysql
&lt;/code&gt;

Hope this helps!</description>
		<content:encoded><![CDATA[<p>Hey Raz (any anyone else with that same problem), I ended up with the same situation here on an Intel machine, the reason for me was that that computer's enter LAMP setup (Mac OS 10.5, Apache 2, MySQL 5, PHP 5, nothing to do with the commercial “MAMP” package) is 64-bit. And, I had an old pdo_mysql.so module which was compiled against the wrong version of MySQL. So my solution was to follow the above compiling instructions, but modify the config command:</p>
<p><code><br />
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS='-O3 -fno-common  -arch x86_64' LDFLAGS='-O3 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch x86_64' \<br />
./configure --prefix=/usr --with-pdo-mysql=/usr/local/mysql<br />
</code></p>
<p>…basically, I removed the 32-bit Intel directives, the PowerPC directives, and also made sure that my MySQL path was correct. For example, a port install of MySQL, and including PowerPC and Intel 32 bit versions might be:</p>
<p><code><br />
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' LDFLAGS='-O3 -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64' \<br />
./configure --prefix=/usr --with-pdo-mysql=/opt/local/lib/mysql5/mysql<br />
</code></p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Gidden</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-18570</link>
		<dc:creator>Tom Gidden</dc:creator>
		<pubDate>Wed, 17 Sep 2008 13:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-18570</guid>
		<description>No idea, sorry... it could be one of many different possible problems.</description>
		<content:encoded><![CDATA[<p>No idea, sorry... it could be one of many different possible problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raz</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-18533</link>
		<dc:creator>Raz</dc:creator>
		<pubDate>Mon, 15 Sep 2008 07:39:03 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-18533</guid>
		<description>I did follow your instructions installing PDO_mysql ... for some reason apache is unable to load the extension. The extension is installed in the right directory and the path where apache is looking for the extension is right. Here is the erro I get in in the apache error log:

[Mon Sep 15 01:20:19 2008] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0
[Mon Sep 15 01:20:19 2008] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 15 01:20:19 2008] [notice] Digest: done
[Mon Sep 15 01:20:19 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2 PHP/5.2.6 configured -- resuming normal operations

Any idea/advice would be greatly appreciate it.

Thank you for your time.</description>
		<content:encoded><![CDATA[<p>I did follow your instructions installing PDO_mysql ... for some reason apache is unable to load the extension. The extension is installed in the right directory and the path where apache is looking for the extension is right. Here is the erro I get in in the apache error log:</p>
<p>[Mon Sep 15 01:20:19 2008] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]<br />
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0<br />
[Mon Sep 15 01:20:19 2008] [notice] Digest: generating secret for digest authentication ...<br />
[Mon Sep 15 01:20:19 2008] [notice] Digest: done<br />
[Mon Sep 15 01:20:19 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2 PHP/5.2.6 configured -- resuming normal operations</p>
<p>Any idea/advice would be greatly appreciate it.</p>
<p>Thank you for your time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gijs van Reijendam</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-17871</link>
		<dc:creator>Gijs van Reijendam</dc:creator>
		<pubDate>Tue, 26 Aug 2008 04:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-17871</guid>
		<description>Thanks for the article. Good Information is rare in the MAC PHP development area. Forcing apache to run in 32 bit also allows you to use extensions packaged with other distributions like MAMP free and get things like mcrypt to work to allow you to run packages like Magento.</description>
		<content:encoded><![CDATA[<p>Thanks for the article. Good Information is rare in the MAC PHP development area. Forcing apache to run in 32 bit also allows you to use extensions packaged with other distributions like MAMP free and get things like mcrypt to work to allow you to run packages like Magento.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Gidden</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-17721</link>
		<dc:creator>Tom Gidden</dc:creator>
		<pubDate>Thu, 21 Aug 2008 09:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-17721</guid>
		<description>Heh... and keep track of all the versions?  I think not! :)

Anyway, I'm convinced the 32-bit mode approach in the comments above is a far better way than I suggested in the main body of the post.</description>
		<content:encoded><![CDATA[<p>Heh... and keep track of all the versions?  I think not! :)</p>
<p>Anyway, I'm convinced the 32-bit mode approach in the comments above is a far better way than I suggested in the main body of the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Viames</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-17716</link>
		<dc:creator>Viames</dc:creator>
		<pubDate>Thu, 21 Aug 2008 05:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-17716</guid>
		<description>You could save us some time giving the compiled packets for x86_64 ;-)</description>
		<content:encoded><![CDATA[<p>You could save us some time giving the compiled packets for x86_64 ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eschnou</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-17494</link>
		<dc:creator>eschnou</dc:creator>
		<pubDate>Fri, 08 Aug 2008 09:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-17494</guid>
		<description>Thanks Tom for this great article ! Facing the same problem, I did the following, based on your suggestion:

- Install mysql (32 bit) from the package on mysql web site
- Compile &#38; install the pdo_mysql extension
- Force apache to run in 32 bit following your advice

It works great; now having PDO_MYSQL both in Apache and command line PHP.</description>
		<content:encoded><![CDATA[<p>Thanks Tom for this great article ! Facing the same problem, I did the following, based on your suggestion:</p>
<p>- Install mysql (32 bit) from the package on mysql web site<br />
- Compile &amp; install the pdo_mysql extension<br />
- Force apache to run in 32 bit following your advice</p>
<p>It works great; now having PDO_MYSQL both in Apache and command line PHP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Gidden</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-16477</link>
		<dc:creator>Tom Gidden</dc:creator>
		<pubDate>Wed, 02 Jul 2008 12:44:16 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-16477</guid>
		<description>Another possible option would be to ignore this entire article, avoid the whole 64-bit mess and force Apache into 32-bit mode.

Since the original Intel Macs used 32-bit Core processors, rather than the 32/64-bit Core 2, the version of Apache must be capable of running 32-bit, so there shouldn't be anything in Mac OS X that needs 64-bit Apache... right?

I can think of two ways of forcing this: either modifying httpd by using &lt;code&gt;lipo&lt;/code&gt; to remove all but the i386 executable, or by overriding &lt;code&gt;/System/Library/LaunchDaemons/org.apache.httpd.plist&lt;/code&gt;

Rather than modifying the file in &lt;code&gt;/System/Library&lt;/code&gt; which is rarely a good idea, just override it by copying &lt;code&gt;/System/Library/LaunchDaemons/org.apache.httpd.plist&lt;/code&gt; to &lt;code&gt;/Library/LaunchDaemons/org.apache.httpd.plist&lt;/code&gt; and change:
&lt;pre&gt;
                &#60;string&#62;/usr/sbin/httpd&#60;/string&#62;
                &#60;string&#62;-D&#60;/string&#62;
                &#60;string&#62;FOREGROUND&#60;/string&#62;
&lt;/pre&gt;
to
&lt;pre&gt;
                &#60;string&#62;arch&#60;/string&#62;
                &#60;string&#62;-i386&#60;/string&#62;
                &#60;string&#62;/usr/sbin/httpd&#60;/string&#62;
                &#60;string&#62;-D&#60;/string&#62;
                &#60;string&#62;FOREGROUND&#60;/string&#62;
&lt;/pre&gt;

Activate it by rebooting or:
&lt;pre&gt;
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo launchctl load /Library/LaunchDaemons/org.apache.httpd.plist
&lt;/pre&gt;

Anyway, I don't know if this approach will work, but you should be able to operate everything in 32-bit mode, which should be a lot simpler.  Use the standard 32-bit PDO, MySQL and so forth.  If you actually need a 64-bit Apache, then you're on your own... the approach in the article above might be the way to go.</description>
		<content:encoded><![CDATA[<p>Another possible option would be to ignore this entire article, avoid the whole 64-bit mess and force Apache into 32-bit mode.</p>
<p>Since the original Intel Macs used 32-bit Core processors, rather than the 32/64-bit Core 2, the version of Apache must be capable of running 32-bit, so there shouldn't be anything in Mac OS X that needs 64-bit Apache... right?</p>
<p>I can think of two ways of forcing this: either modifying httpd by using <code>lipo</code> to remove all but the i386 executable, or by overriding <code>/System/Library/LaunchDaemons/org.apache.httpd.plist</code></p>
<p>Rather than modifying the file in <code>/System/Library</code> which is rarely a good idea, just override it by copying <code>/System/Library/LaunchDaemons/org.apache.httpd.plist</code> to <code>/Library/LaunchDaemons/org.apache.httpd.plist</code> and change:</p>
<pre>
                &lt;string&gt;/usr/sbin/httpd&lt;/string&gt;
                &lt;string&gt;-D&lt;/string&gt;
                &lt;string&gt;FOREGROUND&lt;/string&gt;
</pre>
<p>to</p>
<pre>
                &lt;string&gt;arch&lt;/string&gt;
                &lt;string&gt;-i386&lt;/string&gt;
                &lt;string&gt;/usr/sbin/httpd&lt;/string&gt;
                &lt;string&gt;-D&lt;/string&gt;
                &lt;string&gt;FOREGROUND&lt;/string&gt;
</pre>
<p>Activate it by rebooting or:</p>
<pre>
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo launchctl load /Library/LaunchDaemons/org.apache.httpd.plist
</pre>
<p>Anyway, I don't know if this approach will work, but you should be able to operate everything in 32-bit mode, which should be a lot simpler.  Use the standard 32-bit PDO, MySQL and so forth.  If you actually need a 64-bit Apache, then you're on your own... the approach in the article above might be the way to go.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Gidden</title>
		<link>http://gidden.net/tom/2008/06/30/mysql-and-pdo-on-os-x-leopard-intel/#comment-16471</link>
		<dc:creator>Tom Gidden</dc:creator>
		<pubDate>Wed, 02 Jul 2008 09:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://gidden.net/tom/?p=53#comment-16471</guid>
		<description>I just noticed that this PHP installation prevents command-line PHP from working correctly, with the error:

&lt;pre&gt;
dyld: NSLinkModule() error
dyld: Symbol not found: _core_globals
  Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
  Expected in: dynamic lookup
&lt;/pre&gt;

I suspect that this is because the php command is compiled 32-bit only.  I'm not sure of the "proper" way to fix this, but I got around it by using a different php.ini file for Apache.

First, delete the /etc/php.ini file (or at least, remove the offending extension lines)

Then, create /etc/apache2/php.ini  with the extension lines.

Then, add:
&lt;pre&gt;
        PHPIniDir /etc/apache2
&lt;/pre&gt;
to the middle of /etc/apache2/other/php5.conf
</description>
		<content:encoded><![CDATA[<p>I just noticed that this PHP installation prevents command-line PHP from working correctly, with the error:</p>
<pre>
dyld: NSLinkModule() error
dyld: Symbol not found: _core_globals
  Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
  Expected in: dynamic lookup
</pre>
<p>I suspect that this is because the php command is compiled 32-bit only.  I'm not sure of the "proper" way to fix this, but I got around it by using a different php.ini file for Apache.</p>
<p>First, delete the /etc/php.ini file (or at least, remove the offending extension lines)</p>
<p>Then, create /etc/apache2/php.ini  with the extension lines.</p>
<p>Then, add:</p>
<pre>
        PHPIniDir /etc/apache2
</pre>
<p>to the middle of /etc/apache2/other/php5.conf</p>
]]></content:encoded>
	</item>
</channel>
</rss>
