How can I set a cron and how can I execute it in Unix, Linux, and windows?

How can I set a cron and how can I execute it in Unix, Linux, and windows?

crontab -e

then enter your cron in that file. Write it and save it and the cron will automatically run.

As a security precaution, do not put your cron PHP files in a directory that can be browsed to by the webserver. You can test them by calling PHP from the command lineā€¦ php scriptname.php. For more information on using PHP from the command line look here: http://php.net/manual/en/features.commandline.php

Also, keep in mind php command line tasks do not have a time limit enforced on them. This is a good thing if the task needs time, but it does mean they can hang more easily.