PHP is one of the most popular web programming languages. It lets you quickly create and improve websites, from a simple one-page website to full content management system like WordPress or an ever-changing SaaS.
You may need to do periodic update to your website, e.g. cleaning up inactive users, creating backups, etc.
To do so, create a PHP script to work your magic. Let's save it as cron.php.
You can then set up cronjobs using your hosting's Cron Jobs feature, or run crontab -e on your server.
The cronjob will look like this
30 7 * * * /usr/bin/php /path/to/cron.php
This will run your cronjob once a day at 7:30.
If you can run your script via a browser, use curl to run it:
30 7 * * * curl https://example.com/backend/cron.php
There are several free cronjob services to run your PHP script. Why they are better:
To set up cronjob for your PHP script at FastCron, follow these steps:
https://example.com/backend/cron.php into URL to call.Need help? Reach out to support@fastcron.com - we're happy to help.
See why 8,000+ website developers and their teams use FastCron to run their cronjobs 12 million times a day.
The reliable online cronjob service for your websites since 2009.