cron信息发送了一个奇怪的电子邮件

问题描述:

我从我的服务器的cron信息中得到了这封电子邮件。cron信息发送了一个奇怪的电子邮件

“`client_errors'在共享对象不同的尺寸,考虑重新连接”

这是什么?

这个cron作业只是一个简单的电子邮件的脚本

这是脚本

include("../admin/connect.php"); 
require("../class.phpmailer.php"); 

$from = "[email protected]"; 
$fromname = "Me"; 

    $mail = new PHPMailer(true); //New instance, with exceptions enabled 
$mail->IsSMTP();       // tell the class to use SMTP 
    $mail->SMTPAuth = true;     // enable SMTP authentication 
    $mail->Port  = 587;     // set the SMTP server port 
    $mail->Host  = "smtp.gmail.com"; // SMTP server 
    $mail->Username = "********";  // SMTP server username 
    $mail->Password = "********";   // SMTP server password 
    $mail->SMTPSecure = "tls"; // sets the prefix to the server 
    $mail->IsSendmail(); // tell the class to use Sendmail 


    $mail->From  = $from; 
    $mail->FromName = $fromname; 

    $mail->Subject = "Hi"; 

$edate = date("Y-m-d"); 
$query = "SELECT * FROM `set` WHERE expire = '$edate'"; 
$result = MYSQL_QUERY($query); 

while ($row = mysql_fetch_array ($result)) 
{ 

    $body .= "<pr>Hello<br /><br />"; 
$body .= "Hope everything is ok,<br />"; 

    $text_body = "To view the message, please use an HTML compatible email viewer!"; 

    $mail->Body = $body; 
    $mail->AltBody = $text_body; 
    $mail->AddAddress($row['email']); 


    $mail->Send(); 
    $mail->ClearAddresses(); 

} 

感谢

你正在运行的是需要一个变量(结构或数组,可能)有特定的大小N.不幸的是,提供该变量的值的共享库具有不同的大小M.对“重新链接”的请求可能有点幼稚;这可能意味着使用新的头文件等重新编译并重新链接。

因此,需要重建脚本中使用的某些程序。


在修正问题的光:

我认为这可能是一个问题。有一件事需要担心的是,由cron运行的PHP是否具有正确的环境 - cron不会设置非常多的环境。它可能正在执行一个PHP,但试图从另一个PHP加载库,或者像那样奇怪。

我对运行cron作业的标准建议总是运行一个shell脚本,它在运行“真实”任务之前设置环境(如果需要的话)。这也使得它更容易调试。

{ 
...environment setting... 
env # debug only 
pwd # debug only 
date # debug only 
...exec the real program... 
} >/tmp/log.$$ 2>&1 
+0

我编辑我的问题与我运行的脚本。你觉得这有什么问题吗? thx – 2009-10-29 20:04:59

+0

@Ahmet vardar,当你通过cli或apache运行脚本时会发生什么......只是没有cron位的脚本。 – 2009-10-29 20:10:28

+0

thx乔纳森,@罗纳德,它没有cron正常工作。它真的很奇怪:S – 2009-10-29 20:17:42