I am not at all PHP/Apache fluent and I am having an issue with the only PHP script we have running on an Apache box.
We have a PHP script which as been running fine for a few months.
Suddenly the script stopped working.
This is part of the script:
/* Creación del Archivo */
$filename="tmp/log$TBK_ID_TRANSACCION.txt";
$fp=fopen($filename,"w");
reset($HTTP_POST_VARS);
fwrite($fp,$graba);
fclose($fp);
if (valmac($filename)==0)
{
echo "Mac KO";
exit;
}else{
echo "Mac OK";
exit;
}
function valmac($filename)
{
$cmdline = "cgi-bin/tbk_check_mac.cgi $filename";
//echo $cmdline;
exec($cmdline,$result,$retint);
if ($result[0]=="CORRECTO")
{
return 1;
}
else {
return 0;
}
}
I am getting an error which says
Notice: Undefined offset: 0 in /home/mejoresd/public_html/check_param_mac_tmp.php on line 55
Corresponding to the line
if ($result[0]=="CORRECTO")
I dumped the variables:
$cmdline: string(47) "cgi-bin/tbk_check_mac.cgi tmp/log6581439049.txt"
$result: array(0) { }
$retint: int(126)
After some investigation I found out that something (but what ?) as changed on the server and it seems that script, which creates a file can't get access to it. If you look at the image below you'll see that the "owner" changes from 32044 to 99 between 20/12 and 21/12. Strange enough it is since then that we're having this issue.
What does "owner" means as shown in the pic ? Why did it changed from 32044 to 99 corresponding to the date when the system stopped working properly ?
What does "Undefined offset: 0" mean ?
Jean-Luc
www.corobori.com