Jump to content

Scheduling PHP scripts without using Cron


smus

Recommended Posts

But hypothetically, if we take, for example, time constant from PHP that contains fixed date and time value, then set an interval and place it to a "perpetual" cycle - we will be able to make it, isn't that possible? Or it is too complicated?

Link to comment
Share on other sites

Perpetual loop would continue until condition met, problem is no other coding would be processed until that condition is meet. A user sends request to web server, the web server processes server script language and returns result, that won't happen here it would continue to process until condition met, but max execution time would run out by then and would be exiting out with error message explaining why, 'max_execution time exceeded'.

You might be able to use ajax using js setInterval() to run php script to compare time to current, and if equals or exceeds run scheduled task, but that could cause slowness in website with js always running in backgrond.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...