mysql_close within php causes bus error

Scott Haneda talklists at newgeo.com
Sun Oct 18 18:20:24 PDT 2009


Does anyone have the time to validate a bug I am running into.  The  
below, as it stands, if you change user, pass, and db name, will run  
fine.

If you allow mysql_close($link), that will also work fine.  However,  
if you allow mysql_close() it will immediately kill that thread in  
Apache, and you will see in the errro_log:
[Sun Oct 18 18:16:14 2009] [notice] child pid 5280 exit signal Bus  
error (10)

Other shared sites talking to MySql through php seem to be ok.  I am  
not familiar with the reporting process on this.  How do I determine  
if this is a php issue or a MySql issue, or possibly a ports issue?

      $link = mysql_connect('localhost', 'user', 'pass');
      if (! $link) {
           die('Could not connect: ' . mysql_error()) . '<br />';
      }

      if (! mysql_select_db('db-name', $link)) {
           die('Could not connect: ' . mysql_error()) . '<br />';
      }

      $sql = 'SELECT count(*) FROM table';
      $res = mysql_query($sql);
      if ($error_msg = mysql_error()) echo $error_msg .'<br>';

      print_r(mysql_fetch_assoc($res));

      //mysql_close(); // fails
      //mysql_close($link); // ok

-- 
Scott * If you contact me off list replace talklists@ with scott@ *



More information about the macports-dev mailing list