Dear all,
I am using PHP to explode images on the web, but @ some point there is a memory leak in the system. PHP uses Microsoft Transaction Server on my server(mtx.exe), and it just eats memory like cookie monster....And then @ some point the system goes down....It might be in my code....but I am not sure. Can anybody help me....????
Or is it a known bug???
Greetz
M!ke
Configuration:
NT4 Service Pack 6a
Informix Database
PHP 4.0.3 incl. IFX extension
Script:
<?
Header("Content-Type: image/gif");
$conn_id=ifx_connect('localhost','username','********');
if (! $conn_id)
{ echo(" geen dbase connectie");
}
$browser=getenv("HTTP_USER_AGENT");
$refer=getenv("$HTTP_REFERER");
$rmadr=getenv("$REMOTE_ADDR");
$query_log="INSERT INTO df_views ( site_id,
ip_visitor, refferer, banner_shown, moment,
visitor_browser, pos_id) VALUES ($sid, \"$rmadr\",
\"$refer\", $bid, CURRENT , \"$browser\", 0);";
$query_banner="SELECT path, id, ext FROM df_banners
where banner_id=$bid;";
$res_id_1=ifx_query($query_log,$conn_id);
$res_id_2=ifx_query($query_banner,$conn_id);
$bestandsnaam=ifx_fetch_row($res_id_2);
$theimage="." . $bestandsnaam["path"] . "/" .
$bestandsnaam[id] . "." . $bestandsnaam[ext];
$fn=fopen("./$theimage","r");
fpassthru($fn);
fclose("$fn");
ifx_free_result($res_id_1);
ifx_free_result($res_id_2);
ifx_close($conn_id);
unset($bestandsnaam, $theimage, $fn, $browser, $refer,
$rmadr, $query_log, $querie_banner, $res_id_1,
$res_id_2, $conn_id );
?>