title: PHP/Apache crashing on script (Segmentation fault (11)
body: <p><strong>[SOLVED]</strong></p>
  
  <p>I'm running a PHP script (with some includes) on localhost that keeps crashing before the end.</p>
  
  <p>Error reporting is on. Opera, Safari and Firefox return an empty screen. 
  But Chrome returns:</p>
  
  <blockquote>
    <p>Unable to load the webpage because the server sent no data. Error
    code: ERR_EMPTY_RESPONSE</p>
  </blockquote>
  
  <p>Apache logs returns:</p>
  
  <blockquote>
    <p>[Sun Dec 15 19:29:23 2013] [notice] child pid 34267 exit signal
    Segmentation fault (11)</p>
  </blockquote>
  
  <p>Was using PHP 5.5.6 when I encountered the problem for the first time
  After downgrading to PHP 5.4.21 the problem still exists.</p>
  
  <p>The problem is not inside the script. Randomly commenting out a couple of 50 lines of code solves the problem. Making me wonder if my script might be to long for execution.</p>
  
  <p>Does anyone has any suggestions on how I can resolve this problem?  </p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Problem doesn't only appears on the localhost but also on my webserver running on CentOs 6.4 and PHP 5.3.3 giving the same error on Apache.</p>
  
  <blockquote>
    <p>[Sun Dec 15 23:15:10 2013] [notice] child pid 18409 exit signal
    Segmentation fault (11)</p>
  </blockquote>
  
  <p><strong>UPDATE2:</strong></p>
  
  <p>Running php from the command line gives:</p>
  
  <blockquote>
    <p>$ php index.php    Fatal error: Call to undefined function
    mcrypt_create_iv() in Encrypt.class.php on line 135</p>
  </blockquote>
  
  <p>After placing a comment before line 135 on Encrypt.class.php</p>
  
  <blockquote>
    <p>$ php index.php<br>
    Segmentation fault: 11</p>
  </blockquote>
  
  <p><strong>UPDATE3: (Solution)</strong></p>
  
  <p>After running the index on command line with strace (strace php index.php) I found the problem at one of the queries. </p>
  
  <p>After some more debugging (using PDO instead of my own class) I found out that the problem was setting my own PDO option "ATTR_PERSISTENT => true". Disabling this option solved my problem.</p>