<p>How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.</p>

[{'answer_id': 61799, 'author': 'Alan', 'author_id': 5878, 'author_profile': 'https://Stackoverflow.com/users/5878', 'pm_score': 1, 'selected': False, 'text': '<p>I\'m not sure this will help with the PDO drivers specifically, but you might look into <a href="http://bitnami.org/stack/mappstack" rel="nofollow noreferrer">BitNami\'s MAPPStack</a>.</p>\n\n<p>I had a ton of trouble with Postgres, PHP, and Apache on my Mac, some of it having to do with 64- vs 32-bit versions of some or all of them.  So far, the BitNami MAPPStack install is working nicely in general.  Maybe it will help with your PDO issues as well.</p>\n'}, {'answer_id': 61804, 'author': 'Wilco', 'author_id': 5291, 'author_profile': 'https://Stackoverflow.com/users/5291', 'pm_score': 2, 'selected': False, 'text': '<p>Take a look at this PECL package: <a href="http://pecl.php.net/package/PDO_PGSQL" rel="nofollow noreferrer">PDO_PGSQL</a></p>\n\n<p>I haven\'t tried it myself, but I\'ve been interested in playing with Postgres as an alternative to MySQL. If I have a chance to try it soon, I\'ll throw my results up here in case it helps.</p>\n'}, {'answer_id': 1286153, 'author': 'hbw', 'author_id': 90155, 'author_profile': 'https://Stackoverflow.com/users/90155', 'pm_score': 6, 'selected': True, 'text': '<p>I had to install the PDO_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I\'ve found can help others (like myself) who will undoubtedly run into similar problems.</p>\n\n<p>The first thing you\'ll need to do is <a href="http://pear.php.net/manual/en/installation.getting.php" rel="noreferrer">install PEAR</a>, if you haven\'t done so already, since it doesn\'t come installed on Leopard by default.</p>\n\n<p>Once you do that, use the PECL installer to download the PDO_PGSQL package:</p>\n\n<pre><code>$ pecl download pdo_pgsql\n$ tar xzf PDO_PGSQL-1.0.2.tgz\n</code></pre>\n\n<p>(Note: you may have to run <code>pecl</code> as the superuser, i.e. <code>sudo pecl</code>.)</p>\n\n<p>After that, since the PECL installer can\'t install the extension directly, you\'ll need to build and install it yourself:</p>\n\n<pre><code>$ cd PDO_PGSQL-1.0.2\n$ phpize\n$ ./configure --with-pdo-pgsql=/path/to/your/PostgreSQL/installation\n$ make &amp;&amp; sudo make install\n</code></pre>\n\n<p>If all goes well, you should have a file called "<code>pdo_pgsql.so</code>" sitting in a directory that should look something like "<code>/usr/lib/php/extensions/no-debug-non-zts-20060613/</code>" (the PECL installation should have outputted the directory it installed the extension to).</p>\n\n<p>To finalize the installation, you\'ll need to edit your <code>php.ini</code> file. Find the section labeled "Dynamic Extensions", and underneath the list of (probably commented out) extensions, add this line:</p>\n\n<pre><code>extension=pdo_pgsql.so\n</code></pre>\n\n<p>Now, assuming this is the first time you\'ve installed PHP extensions, there are two additional steps you need to take in order to get this working. First, in <code>php.ini</code>, find the <code>extension_dir</code> directive (under "Paths and Directories"), and change it to the directory that the <code>pdo_pgsql.so</code> file was installed in. For example, my <code>extension_dir</code> directive looks like:</p>\n\n<pre><code>extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"\n</code></pre>\n\n<p>The second step, if you\'re on a 64-bit Intel Mac, involves making Apache run in 32-bit mode. (If there\'s a better strategy, I\'d like to know, but for now, this is the best I could find.) In order to do this, edit the property list file located at <code>/System/Library/LaunchDaemons/org.apache.httpd.plist</code>. Find these two lines:</p>\n\n<pre><code>&lt;key&gt;ProgramArguments&lt;/key&gt;\n&lt;array&gt;\n</code></pre>\n\n<p>Under them, add these three lines:</p>\n\n<pre><code>&lt;string&gt;arch&lt;/string&gt;\n&lt;string&gt;-arch&lt;/string&gt;\n&lt;string&gt;i386&lt;/string&gt;\n</code></pre>\n\n<p>Now, just restart Apache, and PDO_PGSQL will be up and running.</p>\n'}, {'answer_id': 35874398, 'author': 'Mark Horgan', 'author_id': 628709, 'author_profile': 'https://Stackoverflow.com/users/628709', 'pm_score': 0, 'selected': False, 'text': '<p>This is what worked for me</p>\n\n<pre><code>brew install php55-pdo-pgsql\n</code></pre>\n\n<p>This installs PHP 5.5.32 and PostgreSQL 9.5. I already had PostgreSQL 9.4 installed so I uninstalled the homebrew version with:</p>\n\n<pre><code>brew uninstall postgres\n</code></pre>\n\n<p>You then have to update /etc/apache2/httpd.conf to point to the correct PHP version and restart Apache:</p>\n\n<pre><code>LoadModule php5_module /usr/local/Cellar/php55/5.5.32/libexec/apache2/libphp5.so\n</code></pre>\n\n<p>My OSX version is Yosemite.</p>\n'}, {'answer_id': 43703695, 'author': 'yongrui', 'author_id': 2079846, 'author_profile': 'https://Stackoverflow.com/users/2079846', 'pm_score': 1, 'selected': False, 'text': '<p>Install new php version via brew and restart server, and php -v, all issues are removed.</p>\n'}]
['https://Stackoverflow.com/questions/61747', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6371/']