Calling PHP from a Cron job
There are a number of options available to call a PHP script page from a Cron job. The option to use depends very much on your web host and how they have their servers configured. Option 2 is the one that I have found to work for me.
Option 1:
lynx -dump http://www.domain.com/file.php > /dev/null
Option 2:
php -q /home/username/public_html/file.php >/dev/null
Option 3:
wget http://www.domain.com/file.php
Option 4:
get http://www.domain.com/backup.php > /dev/null
September 7, 2006 at 5:56 pm
please help me, where i have to put the line:
php -q /home/public_html/markettari/wp-content/plugins/postie/get_mail.php >/dev/null
???
in wich file? with wich software installed on server?
im trying to set a cron job for get-mail.php wordpress.
thnx
September 7, 2006 at 6:50 pm
Where you put the command depends on your web host.
If you have a free blog hosted by someone like WordPress.com (like this blog) then you probably can’t create Cron jobs.
If you have full website hosting with a control panel such as CPanel or Plesk then there should be some sort of Cron manager that lets you setup a Cron job and allows you to pick what day/time to run it.
March 27, 2007 at 1:34 pm
yo! i’ll come back…http://google.com.uk
March 30, 2007 at 8:18 pm
My host (jodohost.com) has an Apache based Server API. You can find out by creating a test.php file and typing in it.
Mine works with curl:
curl -s -o /dev/null http://www.domain.com/wp-content/plugins/postie/get_mail.php
June 6, 2007 at 6:17 pm
http://greatamps.info/replica-watches/man-replica-watch.php
June 25, 2007 at 12:26 am
100$ per click
July 19, 2007 at 10:17 am
Hi All,
I have set my cronjob in crontab,
45 12 * * * root wget http://localhost/test.php
its working fine. But after executing this cronjob everytime an empty file is get created in /root
Can anybody tell why this is happening?
Thanks in advance.
October 9, 2007 at 5:31 am
home online typing jobs
typing jobs at home
May 11, 2008 at 11:01 am
Swati, try this command instead:
/usr/bin/wget -O - -q http://www.telenovela.com/cron.php
the -O - says to write the file to stdout, the -q to shut up)