I had a script which sends sms alerts everyday. I want it to send automatically send sms by fetching message from database. Can I do it without cron. Is there any other solution. Plz help
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Is there a way to play audio on a mobile browser w
Have an outside AppEngine cron job sheduler: Use google AppEngine, it's free. The outside "task" can then "callback" a PHP script of yours.
I fail to see what's wrong with using the local
cron
on your machine though aside from it being blocked for you to access.In simple words, you can't run php scripts without using some sort of scheduler or cron...
This isn't the best answer as it still requires cron somewhere, but you could always setup another machine that does have cron, like your home computer for instance, to hit a page on your site which triggers the action (using a library like
curl
orwget
).Using third party webcron like easycron.com.
You have a couple of options:
Emulate cron behavior: In your php code, check if the page was loaded at, or close to, the time you wish to schedule the sendout for, if the messages havent been sent yet, load the script that sends the messages in the background and flag them as sent.
As others have suggested, setup a cronjob somewhere else that will execute a script on your server by fetching the url via http (by using wget for example)
You can use a webcron service to trigger your script.