I have a problem when executing the PHP files as background process. I have two PHP file as follow :
index.php
<?php
$cmd = "php cmdReadReport.php";
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
?>
cmdReadExcel.php
<?php
$reportname = "./report/lw321.xls";
$thereport = new Report();
$thereport->readReport($reportname)
?>
My goal is to run Report.readReport as background process. readReport function is function which reads Excel file and saves its rows to database.
I have followed the tutorial but there is no result/no rows inserted. Is there anything wrong in the code?
Regards,