Php 如何查找cron作业中的cron超时或错误?

Php 如何查找cron作业中的cron超时或错误?,php,cron,Php,Cron,我从远程服务器获取一些数据并将其输入我的站点数据库。它有900k条记录(应用程序),但插入的记录仅阻止了60180条记录。我们使用mailto和异常处理程序查找bug,但没有响应 有人能就如何获取cron超时提供建议吗?或者我们的代码中是否有错误 <?php set_time_limit(0); ignore_user_abort(); try { $ch = curl_init(); // set URL and other appropriate options curl_

我从远程服务器获取一些数据并将其输入我的站点数据库。它有900k条记录(应用程序),但插入的记录仅阻止了60180条记录。我们使用
mailto
和异常处理程序查找bug,但没有响应

有人能就如何获取cron超时提供建议吗?或者我们的代码中是否有错误

<?php
set_time_limit(0);
ignore_user_abort();
try
{
  $ch = curl_init();
  // set URL and other appropriate options
  curl_setopt($ch, CURLOPT_URL, "http://ks329xxx.com/cronRU/update");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  // grab URL and pass it to the browser
  curl_exec($ch);

  // close cURL resource, and free up system resources
  curl_close($ch);
}
catch (Exception $e) 
{
  echo 'Caught exception: ',  $e->getMessage(), "\n";
  mail('varunxxxx@xxxxx.com', 'update', $message);  
}
?>

您没有检查
curl\u exec()的结果。


您没有检查
curl\u exec()
的结果:


我编辑了一点你的帖子——每当有人提到一个,它就会引起混乱:)我编辑了一点你的帖子——每当有人提到一个,它就会引起混乱:)
if (curl_exec($ch) === false) {
    throw new Exception(curl_error($ch));
}