the fopen() fails and it outputs
Warning: fopen(logs/response_rowbody/230.mlog): failed to open stream: No such file or directory in C:\xampp\htdocs\test.php on line 5
after hours of isolating the reasons that might be causing the problem, I found it is because the function is called in function registered with register_shutdown_function . and I don't know if this is normal or not!
this is the code that I use
this code works
the file C:\xampp\htdocs\test.php
<?php
//register_shutdown_function('logresponse');
/*the function logresponse() works here because it has been called naturaly at the end of the file without being shut_down_registered*/
logresponse();
function logresponse(){
$response_rowbody = "logs/response_rowbody/230.mlog";
$fhandle = fopen($response_rowbody,"wb");if(!$fhandle){echo"errorrr";};
exit;};
?>
this code does not work
the file C:\xampp\htdocs\test.php
<?php
register_shutdown_function('logresponse');
/*the function logresponse() does NOT work here because it has been called as a shut-down registered function*/
//logresponse();
function logresponse(){
$response_rowbody = "logs/response_rowbody/230.mlog";
$fhandle = fopen($response_rowbody,"wb");if(!$fhandle){echo"errorrr";};
exit;};
?>
what am I doing wrong here?? thanks.