How to automatically run a PHP script daily?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
misch
Forum Newbie
Posts: 1
Joined: Wed Apr 16, 2003 1:13 pm

How to automatically run a PHP script daily?

Post by misch »

Hi,
I am trying to run a PHP script daily at the end of each day, sending out emails and updating the database.. I have no idea how to do it in PHP..

From what I read, cron seems to be the way, but my ISP did not installed it...

I heard you can wrapped PHP within some CGI code to let it run automatically, but I could not find any clear explaination. Would be great to get some help regarding any good ways to automatically run a PHP script.

Thanks for any help!
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

If you do not have access to crontab on your server then you could use the service provided by fastcron.com or install fake cron on your Server, providing you can execute CGI scripts. You can download the fake cron from smarterscripts.com.

Hope this helps.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

If you are running windows...

Start > Programs > Accessories > System Tools > Scheduled Tasks > Add new task


I suggest adding a .url file so it opens the link in IE instead of an editor for php. :)
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

On linux, i made a cronjob to a cgi script that looked like this.

Code: Select all

#!/usr/bin/perl
require "http-lib.pl";
$p = &HTTPGet("/page.php","www.domain.com",80,"?foo=bar");
print $p;
papayiya
Forum Newbie
Posts: 1
Joined: Thu Nov 25, 2004 6:16 pm

Post by papayiya »

Kriek wrote:If you do not have access to crontab on your server then you could use the service provided by fastcron.com or install fake cron on your Server, providing you can execute CGI scripts. You can download the fake cron from smarterscripts.com.

Hope this helps.
I used fastcron -- but for some reason the site is down for a while ... I use http://www.webbasedcron.com -- it's reliable and hasn't been down

Good luck
Post Reply