title: pdo_mysql crashes PHP on windows
body: <p>I've been having a problem with using pdo_mysql on Windows. (Also tried with mysqli briefly.)
  It works fine on my Debian server. But since my work's computers are set up with wamp or xampp servers (tried both) I can't really ignore a windows-only problem.</p>
  
  <p>Specifically this is the code I have problems with:</p>
  
  <pre><code>$sql  = "SELECT `TABLE_NAME`, `TABLE_ROWS` FROM "
        . "`information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = "
        . ":schema AND `TABLE_NAME` NOT LIKE 'stf_%'";
  $stmt = self::$pdo-&gt;prepare($sql);
  $stmt-&gt;bindParam(':schema', self::$settings['schema']);
  $stmt-&gt;execute();
  $tables = $stmt-&gt;fetchAll(\PDO::FETCH_ASSOC);
  $stmt-&gt;closeCursor();
  unset($sql,$stmt);
  $return = [];
  for ($i = 0; $i &lt; count($tables); $i++) {
      $table = $tables[$i]['TABLE_NAME'];
      $rows = $tables[$i]['TABLE_ROWS'];
      $sql = "SELECT * FROM `{$table}`";
      $stmt = self::$pdo-&gt;prepare($sql);
      $stmt-&gt;execute();
      // This piece fails in Windows:
      $return[$table][] = $stmt-&gt;fetchAll(\PDO::FETCH_ASSOC);
      // I've also tried using loops with fetch.
      // They work for a few rows and then crash.
      unset($table,$sql,$stmt);
  }
  var_dump($return);
  </code></pre>
  
  <p>What happens is it gets the name of the tables in a certain schema and then is supposed to pull all the content of those tables into the <code>$return</code> array. When <code>fetchAll</code> failed I tried various loops, everything from <code>foreach</code> to <code>while</code> to <code>for</code> and it always results in PHP crashing at some point or another.</p>
  
  <p>When In some tables with more than a couple rows after a certain number of rows PHP suddenly crashes without producting any errors in any logs. I have my logs set to the highest debugging levels since this is a development environment.</p>
  
  <p>Here's exactly what I get when it fails:</p>
  
  <blockquote>
    <p>HTTP/1.1 200 OK<br>
        Date: Wed, 03 Jun 2015 13:55:29 GMT<br>
        Server: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8<br>
        X-Powered-By: PHP/5.6.8<br>
        Last-Modified: <br>
        Accept-Ranges: bytes<br>
        Content-Length: 0<br>
        X-UA-Compatible: IE=edge<br>
        X-Content-Type-Options: nosniff<br>
        Keep-Alive: timeout=5, max=99<br>
        Connection: Keep-Alive<br>
        Content-Type: text/html;charset=UTF-8</p>
  </blockquote>
  
  <p>Due to which I haven't been able to figure it out.</p>
  
  <p>Essentially the I'm trying to take a badly written old schema and organize it in PHP in a way that conforms with our new schema. So I can do a single call for a certain piece of data and get it independent of whether the DB uses the old or new Schema. So... Backward compatibility, basically.</p>
  
  <p>Anyway, here's a link to the data I get from the Debian server using the same code. (Proof it works!)
  <a href="http://deviousconcepts.com/" rel="nofollow">http://deviousconcepts.com/</a></p>