简体   繁体   English

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

[英]cron info sent a weird email

I got this email from cron info of my server. 我从服务器的cron信息中收到了此电子邮件。

"`client_errors' has different size in shared object, consider re-linking" “`client_errors'在共享库中具有不同的大小,请考虑重新链接”

what is this ? 这是什么 ?

this cron job is just a simple email script 这个Cron工作只是一个简单的电子邮件脚本

this is the script 这是脚本

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

$from = "Me@me.com";
$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();

}

thanks 谢谢

Something you are running expects a variable (structure or array, probably) to have a particular size N. Unfortunately, the shared library providing the value of that variable has a different size M. The request to 're-link' is perhaps a little naïve; 您正在运行的东西期望变量(可能是结构或数组)的大小为N。不幸的是,提供该变量值的共享库的大小为M。“重新链接”的请求可能有点幼稚; it probably means recompile and relink using the new headers, etc. 这可能意味着使用新的标头等进行重新编译和重新链接。

So, some program used in your script needs to be rebuilt. 因此,需要重建脚本中使用的某些程序。


In light of the amended question: 鉴于经修正的问题:

I think it could be a problem. 我认为这可能是个问题。 One thing to worry about is whether the PHP that is run by cron has the correct environment - cron does not set very much environment. 值得担心的一件事是,由cron运行的PHP是否具有正确的环境-cron不会设置太多环境。 It could be executing one PHP but trying to load a library from another, or something weird like that. 它可能正在执行一个PHP,但是试图从另一个PHP加载一个库,或者类似的事情。

My standard advice for running cron jobs is always to run a shell script, which sets the environment if necessary before running the 'real' task. 我对运行cron作业的标准建议始终是运行shell脚本,该脚本会在运行“真实”任务之前根据需要设置环境。 This also makes it easier to debug. 这也使调试更加容易。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM