[英]cron info sent a weird email
我從服務器的cron信息中收到了此電子郵件。
“`client_errors'在共享庫中具有不同的大小,請考慮重新鏈接”
這是什么 ?
這個Cron工作只是一個簡單的電子郵件腳本
這是腳本
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();
}
謝謝
您正在運行的東西期望變量(可能是結構或數組)的大小為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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.