title: Native PHP / Mysql installation on Mac, activating the PDO driver
body: <p>I have a custom installation on the MacOSX Lion consisting of the following:</p>
  
  <ol>
  <li>Native PHP upgraded to 5.4, works like a charm.</li>
  <li>Installed MySQL, being run from /usr/local/mysql-5.5.25-osx10.6-x86_64/bin/mysql, works like a charm, Workbench connects and can do ops.</li>
  <li><p>Edited php.ini in /etc/ to activate the following:</p>
  
  <pre><code>extension=php_mysqli.so
  extension=php_pdo_pgsql.so
  extension=php_pdo_mysql.so
  </code></pre></li>
  <li><p>phpinfo() says the following:</p>
  
  <p>PDO</p>
  
  <p>PDO support enabled
  PDO drivers mysql, pgsql, sqlite</p>
  
  <p>pdo_mysql</p>
  
  <p>PDO Driver for MySQL    enabled
  Client API version  mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $</p>
  
  <p>Directive   Local Value Master Value
  pdo_mysql.default_socket    /var/mysql/mysql.sock   /var/mysql/mysql.sock</p></li>
  </ol>
  
  <p>That means it works, yes?</p>
  
  <p>Two problems though:</p>
  
  <ul>
  <li><p>No such file as /var/mysql/mysql.sock, it's in /tmp/mysql.sock. But I configured and built php with the PDO options on: --with-mysql=mysqlnd  --with-mysqli=mysqlnd  --without-pear  --with-pdo-mysql=mysqlnd  --with-mysql-sock=/var/mysql/mysql.sock. No effect if I change the ini setting to /tmp/mysql.sock, it's reflected in php.ini, but the error stays exactly the same.</p></li>
  <li><p>When I try to instantiate the PDO class inside PHP, this happens: 
  Uncaught exception 'PDOException' with message 'could not find driver'</p></li>
  </ul>
  
  <p>When I try accessing MySQL from PHP in an old school mysqli kind of way, I get this:</p>
  
  <p>Failed to connect to MySQL: (2002) No such file or directory Warning: main(): Couldn't fetch mysqli in...</p>
  
  <p>What else can I try to make my PHP and my MySQL play nice?</p>