Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run a php automatically after every hour

I am using a shared windows hosting in which sending 120 mails/hour is allowed though php code. i have a php page to send emails more than 200 mails at a time.But i want to run the page, after every hour(scheduled task). I will split the emails(in 100s) and want send automatically after every hour.

How is this possible in php to run a php page after every hour ?

Thanks

like image 353
logan Avatar asked Feb 16 '26 13:02

logan


2 Answers

Use PHP Cron Jobs with cPanel

cPanel Simple Cron

you can get started with the simple cron tool built into cPanel. The url for it is:

https://www.yoursite.com/page.php

The command to run:

/usr/local/bin/php -f /home/(username)/public_html/page.php

Next you'll want to select an option from all the select boxes. Remember to select an option in each box. If you want something to run every hour, select Minute: 60; Hour:Every; Day: Every; Month: Every; Weekday: Every;

Click save and you are all set! You'll get an email every time the cron job runs, but if you don't want to get it - put :blackhole: into the output email field at the top.

like image 120
thecodedeveloper.com Avatar answered Feb 18 '26 01:02

thecodedeveloper.com


Use a script on Google AppEngine to "ping" yours (Scheduled Tasks to be more precise). It's free to use.

like image 32
Fahim Parkar Avatar answered Feb 18 '26 02:02

Fahim Parkar