As you have been told in comments, cron jobs on Linux or Windows Task Scheduler on Windows is the natural solution for your problem.
However there is a workaround that you can do to avoid them in the mean time, you can make script that triggers your page every 1 hour
trigger.php
<?php
ini_set('max_execution_time', 0); //unlimited
$iterations = 0;// allow only 100 iterations, increase if you need
while ($iterations <= 100){
$iterations++;
file_get_contents("http://yourdomain/Live_Cricket\API\news_agg_api_curl.php");
sleep(3600); // sleep for 1 hour
}
You will have to execute it the first time from your terminal/CMD
php -f C:\xampp\htdocs\path\to\trigger.php
Note: you must execute this file from the PHP CLI (like I did ), not from a browser, to avoid Apache's Timeout directive which will end the execution after the Timeout period if you opened trigger.php
from the browser. And execute it every time you reboot your machine.
Also note that file_get_contents
will not work if allow-url-fopen is disabled. you can also use curl for that.
Don't forget to remove header("refresh: 3600");
.