PHP script halts on a mysql query with no exception thrown and no entry in php error log
<p>I have a script that produces a report.  For most widgets* it produces a report with no problem. For a particular widget it exits in the middle during a mysql query and a 500 is returned to the browser.  By inserting writes to the php_error log I know the exact last line to be executed and it's always the same line.  It's not a timeout because other widget reports run longer (and it bombs out in about 10 seconds).</p>

<p>Also, I've tried running the query it's trying to run in phpadmin and it runs OK.</p>

<p>When this abort occurs I see nothing appear in php_error.log, nothing in apache's error log and when I surround the offending statement with a try/catch, no exception is caught.</p>

<p>Is there somewhere else I can look that might show what error is occurring?</p>

<p>* by widget I'm not referring to a UI component.  I'm using widget in the sense of fictional product from a fictional company</p>

<p>addendum ======================================================================
Since it was requested I posted the code although I think the problem isn't the code since it works in all but this once case.  The problem is more likely in the data for this particular case.</p>

<pre><code>error_log('['.__FILE__.']['.__LINE__."] check");

$table = new metrics_sessions();

//here I print out the SQL statement that will eventually be executed
error_log('['.__FILE__.']['.__LINE__."] check: "."guider_slug=? ".($effective_mindate!=null?" and date&gt;'".$effective_mindate."'":"").($effective_maxdate!=null?" and date&lt;'".$effective_maxdate." 23:59:59'":"").($effective_version!=0 &amp;&amp; $effective_version!="all"?" and version=".$specific_version:"").($effective_campaign!==null &amp;&amp; $effective_campaign!="all" ?" and campaign='".$effective_campaign."'":"")." order by date");

// BELOW IS THE LAST LINE I SEE IN PHP ERROR
error_log('['.__FILE__.']['.__LINE__."] check"); 

try {

    $sessions = $table-&gt;Find("guider_slug=? ".($effective_mindate!=null?" and date&gt;'".$effective_mindate."'":"").($effective_maxdate!=null?" and date&lt;'".$effective_maxdate." 23:59:59'":"").($effective_version!=0 &amp;&amp; $effective_version!="all"?" and version=".$specific_version:"").($effective_campaign!==null &amp;&amp; $effective_campaign!="all" ?" and campaign='".$effective_campaign."'":"")." order by date",array($param_gslug));

    error_log('['.__FILE__.']['.__LINE__."] check");

}catch(Exception $e){

    error_log('['.__FILE__.']['.__LINE__."] check");
    error_log('Caught exception: '.$e-&gt;getMessage());
    error_log('File: '.$e-&gt;getFile());
    error_log('Line: '.$e-&gt;getLine());
    error_log('Trace: '.$e-&gt;getTraceAsString());

}

error_log('['.__FILE__.']['.__LINE__."] session count: ".count($sessions));
</code></pre>
