how to run php as background process -
i have problem when executing php files background process. have 2 php file 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 run report.readreport background process. readreport function function reads excel file , saves rows database.
i have followed tutorial there no result/no rows inserted. there wrong in code?
regards,
you initiate script execution client instead of server. this:
www.example.com/scripts/cmdreadreport.php?keypass=giw3m4d9bajo0ua0wftg
then request page curl or something. approach more portable.
Comments
Post a Comment