-
Sep 21st, 2006, 11:57 PM
#1
Thread Starter
Fanatic Member
Newbie Q:Is it possible to have PHP script run on server every minute automatically
I'm trying to make a script that will monitor a certain site (eg: weather forecast) and if it contains a certain value then the script must email me.
I want this script to continually run, but without me having to open it in my web browser.
So is it possible to make the script execute on the server every 1 minute or so?
If not in PHP, then what language is this possible in?
-
Sep 22nd, 2006, 03:39 AM
#2
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
You can run a PHP script stanalone from by simple supplying it with the script path:
Code:
# linux
~# php script.php
# windows
C:\>\path\to\php.exe script.php
in linux you can use a cron job to have it run every minute. In windows you can have it run as a scheduled task.
-
Sep 24th, 2006, 04:07 AM
#3
Thread Starter
Fanatic Member
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
Thanx for the help.
How would I setup the cron job if I'm using GoDaddy shared Linux hosting?
-
Sep 24th, 2006, 06:54 PM
#4
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
i don't know how their interface is set up, so you could try either asking their technical support about setting up a cron job, or just start looking through your control panel for anything about scheduled tasks or cron jobs.
-
Sep 24th, 2006, 10:15 PM
#5
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
Originally Posted by shirazamod
Thanx for the help.
How would I setup the cron job if I'm using GoDaddy shared Linux hosting?
I'm pretty sure GoDaddy hosting doesn't support this. I briefly looked into them for hosting and it didn't seem that great.
-
Sep 25th, 2006, 12:06 AM
#6
Thread Starter
Fanatic Member
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
Damn! Do you know of any free hosts that support cron jobs?
-
Sep 25th, 2006, 03:31 AM
#7
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
I highly doubt that there are any free hosts that would. you can try searching, but I wouldn't be surprised if you didn't find anything.
-
Sep 25th, 2006, 05:28 AM
#8
Thread Starter
Fanatic Member
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
I've actually found a few by searching Google, but none of them seem to work fine.
I've found a PHP script called Virtual Crontab which supposedly allows you to simulate Cron jobs, but I haven't been able to check it out yet (I'm not on my own computer)
-
Sep 25th, 2006, 07:56 AM
#9
<?="Moderator"?>
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatical
Originally Posted by shirazamod
I've actually found a few by searching Google, but none of them seem to work fine.
I've found a PHP script called Virtual Crontab which supposedly allows you to simulate Cron jobs, but I haven't been able to check it out yet (I'm not on my own computer)
Ive looked into this and these scripts do work, how ever if the webserver is restarted you need to manualy call the scripts again.
-
Sep 25th, 2006, 08:49 PM
#10
Thread Starter
Fanatic Member
Re: Newbie Q:Is it possible to have PHP script run on server every minute automatically
Thanks for the heads up.
Do you know of any way around this? Also, do you happen to know how often GoDaddy would restart their servers (every day? week? month?)
I think a possible workaround would be to setup virtual cron jobs on 2 different servers, and somehow make each one check that the other is working, and if not then it must call the script on the other server. Think it'll work?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|