PHP脚本停止了mysql查询,没有抛出异常,也没有在PHP错误日志中记录


PHP script halts on a mysql query with no exception thrown and no entry in php error log

我有一个生成报告的脚本。对于大多数小部件*,它会毫无问题地生成报告。对于一个特定的小部件,它在mysql查询的中间退出,并返回一个500给浏览器。通过向php_error日志插入写操作,我知道要执行的最后一行,而且总是同一行。这不是一个超时,因为其他小部件报告运行时间更长(它在大约10秒内爆炸)。

另外,我已经尝试运行查询,它试图在phpadmin中运行,它运行正常。

当这个中止发生时,我看到php_error.log中没有任何内容,apache的错误日志中也没有任何内容,当我用try/catch包围违规语句时,没有捕获异常。

是否有其他地方,我可以看看,可能会出现什么错误?

* by widget我指的不是UI组件。我使用的widget是来自虚构公司的虚构产品

附录 ======================================================================因为它是要求我张贴的代码,虽然我认为问题不是代码,因为它在所有工作,但这一次的情况下。这个问题更有可能出现在这个特殊情况下的数据中。

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>'".$effective_mindate."'":"").($effective_maxdate!=null?" and date<'".$effective_maxdate." 23:59:59'":"").($effective_version!=0 && $effective_version!="all"?" and version=".$specific_version:"").($effective_campaign!==null && $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->Find("guider_slug=? ".($effective_mindate!=null?" and date>'".$effective_mindate."'":"").($effective_maxdate!=null?" and date<'".$effective_maxdate." 23:59:59'":"").($effective_version!=0 && $effective_version!="all"?" and version=".$specific_version:"").($effective_campaign!==null && $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->getMessage());
    error_log('File: '.$e->getFile());
    error_log('Line: '.$e->getLine());
    error_log('Trace: '.$e->getTraceAsString());
}
error_log('['.__FILE__.']['.__LINE__."] session count: ".count($sessions));

检查代码和正在调用的代码中的错误抑制操作符(@)

尝试编辑错误php.ini文件,以允许显示警告和错误代码。

error_reporting = E_ALL | E_STRICT  

这就足够了。