Cron Jobs are closed on my server and server admin doesn\'t accept open it. Because , cron jobs slowing server etc. So, i need an alternative.
I have to run a php fi
Just an addition to the Answers. Rare case scenario.
If your application is having frequent amount of database operations then you can maintain a separate table where the the one column will work as a measure when to run the script. Example as below
Table CRON_RUN
last_run
----------
12-09-2018 11:55:12 (dd-mm-yyyy H:M:S)
Now in your application a check can be performed every time when those frequent db operations occurs and check if the last_run date and the current date is having x difference . X is difference in time you want to run the script. 2 minutes in your case. Also if the difference is more then or equal to 2 minutes then the update statement will run to update the last_run column with the current date time and the next statement will be you cron.php script .
There are several Cron alternatives for Linux. Like,
Anacron - Anacron is a periodic command scheduler just like cron. The only difference is that it does not need your computer to be always running.
fcron - Fcron is the best of both cron and anacron. It doesn’t require your computer to be running 24×7, and it can work with tasks on an hourly or minute basis.
Hcron
Jobber etc.
For future reading refer to this article.