PHP uses the monitoring tool to execute automatic tasks of Whmcs. In fact, it is feasible to use Linux to schedule tasks,... No -_-
You can use the timed access feature of the monitoring site to execute the scheduled task of Whmcs.
However, the tangle is coming... The longest monitoring interval of the monitoring site is 1 hour...
So this code was born...
First, analyze it. if the monitoring site accesses the specified URL once every hour, a counter is required, and because it cannot be resident in memory, it is difficult to write SQL statements. so, use file storage.
24 hours a day, the monitoring site will visit 24 times, but the monitoring site will have two nodes to access at the same time, so 24x2 = 48.
I am not familiar with php, so I will not consider concurrency issues here. because file operations are involved, it is impossible to have no permissions.
Release code ..
= 48) {// the monitoring site has two nodes for simultaneous access, so this is not a 24-hour foreach ($ urls as $ key = >$ value) {file_get_contents ($ value );} $ count = 0;} echo "$ count"; DeleteFile ($ fileName); CreateFile ($ fileName, $ count);} // create a file function CreateFile ($ fileName, $ value) {$ fp = fopen ($ fileName, "w +"); fwrite ($ fp, $ value); fclose ($ fp );} // delete the file function DeleteFile ($ fileName) {@ unlink ($ fileName) ;}?>
The test still works. * ^ *
Finally, how can we tell you that cloud products such as .. bae and da and cp panels support cron ..