origin
Regular Member
- Nov 11, 2008
- 333
- 93
Cron job is like time scheduler. I noticed that some of you have no idea how to make cron jobs working. I collected information from many resources, so here it is:
Cron job working via CPanel
1. Login to your cpanel.
2. Click cron icon.
3. Click standard.
4. Enter your email address for reporting if the cron is failed.
5. Choose the time what you want.
6. Enter the command, it depends on your server hosting.
the command should be like this:
if curl is disable form your hosting service, you can use another way, with this:
if curl and lynx is disable form your hosting service, you can use another way, with this:
or
if curl, lynx and wget is disable form your hosting service, you can use another way, with this:
in the your_script.php file put this at the top the first line before anything:
and use this cron command
note:
file your_script.php should chmod 755
and the /home/your_username/ is your path on server.
if you have still problem, like " No input file specified. ", please try this:
Save it and done...
Hope this helps.
Cron job working via CPanel
1. Login to your cpanel.
2. Click cron icon.
3. Click standard.
4. Enter your email address for reporting if the cron is failed.
5. Choose the time what you want.
6. Enter the command, it depends on your server hosting.
the command should be like this:
Code:
curl -s -o /dev/null http://yourdomain.com/your_script.php
if curl is disable form your hosting service, you can use another way, with this:
Code:
lynx -dump http://yourdomain.com/your_script.php > /dev /null
if curl and lynx is disable form your hosting service, you can use another way, with this:
Code:
/usr/bin/wget -O /dev/null /home/your_username/public_html/script.php
or
Code:
GET http://yourdomain.com/your_script.php > /dev /null
if curl, lynx and wget is disable form your hosting service, you can use another way, with this:
in the your_script.php file put this at the top the first line before anything:
Code:
!#/usr/bin/php
and use this cron command
Code:
php -f /home/your_username/public_html/your_script.php
note:
file your_script.php should chmod 755
and the /home/your_username/ is your path on server.
if you have still problem, like " No input file specified. ", please try this:
Code:
links http://yourdomain.com/your_script.php
Save it and done...
Hope this helps.