tags:

views:

42

answers:

1

Hi

I got this email from cron info of my server.

"`client_errors' has different size in shared object, consider re-linking"

what is this ?

this cron job is just a simple email script

this is the script

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();

}

thanks

A: 

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; 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. It could be executing one PHP but trying to load a library from another, or something weird like that.

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. 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
Jonathan Leffler
i edited my question with the script that i run. is there any problem in this u think ? thx
Ahmet vardar
@Ahmet vardar, what happens when you run the script via cli or apache...just the script without the cron bit.
Ronald Conco
thx Jonathan, @Ronald, it works great normally without cron. it is really weird :S
Ahmet vardar
@Ahmet: when something works normally without cron and abnormally with cron, the answer is probably 99 times out of 100 due to differences in the environment. Hence the example above. You can do your debug redirection differently if necessary - for example, capture the debug information as shown but execute the command outside the '{ ... }' I/O redirection.
Jonathan Leffler