How do you make a script run automatically?

This is a discussion on How do you make a script run automatically? within the PHP Language forums, part of the PHP Programming Forums category; Please forgive me if this has been asked before. Is it possible to have a php script run automatically? I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-05-2004
Spidah
 
Posts: n/a
Default How do you make a script run automatically?

Please forgive me if this has been asked before.

Is it possible to have a php script run automatically?

I am talking about the sort of script that handles regular activities such
as issuing invoices, reminders etc? How are these run? Does somebody have to
go in and push a button, do you have to tell the
server to run these scripts at a particular time, or is there another way?

Thanks

Hamilton


Reply With Quote
  #2 (permalink)  
Old 11-05-2004
Michael Fesser
 
Posts: n/a
Default Re: How do you make a script run automatically?

.oO(Spidah)

>Please forgive me if this has been asked before.
>
>Is it possible to have a php script run automatically?


With a cronjob (Unix/Linux) or another kind of scheduling mechanismn.

Micha
Reply With Quote
  #3 (permalink)  
Old 11-06-2004
Ed Jones
 
Posts: n/a
Default Re: How do you make a script run automatically?

Michael Fesser wrote:
> .oO(Spidah)
>
>
>>Please forgive me if this has been asked before.
>>
>>Is it possible to have a php script run automatically?

>
>
> With a cronjob (Unix/Linux) or another kind of scheduling mechanismn.
>


....and only if PHP's installed as a CGI (on Unix/Linux).

Ed
Reply With Quote
  #4 (permalink)  
Old 11-06-2004
Daniel Tryba
 
Posts: n/a
Default Re: How do you make a script run automatically?

Ed Jones <home-newsgroups@edjones.org> wrote:
>>>Is it possible to have a php script run automatically?

>>
>>
>> With a cronjob (Unix/Linux) or another kind of scheduling mechanismn.
>>

>
> ...and only if PHP's installed as a CGI (on Unix/Linux).


BS:
* 0 * * * lynx http://localhost/shedule/this/script.php

Where lynx can be replaced by lots of other commands (like nc, wget,
w3m, curl...)

--

Daniel Tryba

Reply With Quote
  #5 (permalink)  
Old 11-06-2004
lawrence
 
Posts: n/a
Default Re: How do you make a script run automatically?

"Spidah" <h.laughland@eggstra.co.nz> wrote in message news:<OJRid.4061$op3.153462@news.xtra.co.nz>...
> Please forgive me if this has been asked before.
>
> Is it possible to have a php script run automatically?
>
> I am talking about the sort of script that handles regular activities such
> as issuing invoices, reminders etc? How are these run? Does somebody have to
> go in and push a button, do you have to tell the
> server to run these scripts at a particular time, or is there another way?


Use PHP 5 which makes it easy to turn a script into a daemon that can
run as a normal service on any computer. Then just write the script as
you would any other computer program, launch it once and it will run
forever. If you want a reminder, just have it keep a list of dates (in
an array, or XML, or a database, or anything else) and it can send a
message to standard output when you need the reminder, or, better, it
can send you an email.
Reply With Quote
  #6 (permalink)  
Old 11-06-2004
Ed Jones
 
Posts: n/a
Default Re: How do you make a script run automatically?

Daniel Tryba wrote:
> Ed Jones <home-newsgroups@edjones.org> wrote:


>>...and only if PHP's installed as a CGI (on Unix/Linux).

>
> BS:
> * 0 * * * lynx http://localhost/shedule/this/script.php
>
> Where lynx can be replaced by lots of other commands (like nc, wget,
> w3m, curl...)
>

Yeah, cool - hadn't thought of doing it like that :-)

Ed
Reply With Quote
  #7 (permalink)  
Old 11-07-2004
Spidah
 
Posts: n/a
Default Re: How do you make a script run automatically?


"lawrence" <lkrubner@geocities.com> wrote in message
news:da7e68e8.0411060123.344707f@posting.google.co m...
> "Spidah" <h.laughland@eggstra.co.nz> wrote in message
> news:<OJRid.4061$op3.153462@news.xtra.co.nz>...
>> Please forgive me if this has been asked before.
>>
>> Is it possible to have a php script run automatically?
>>
>> I am talking about the sort of script that handles regular activities
>> such
>> as issuing invoices, reminders etc? How are these run? Does somebody have
>> to
>> go in and push a button, do you have to tell the
>> server to run these scripts at a particular time, or is there another
>> way?

>
> Use PHP 5 which makes it easy to turn a script into a daemon that can
> run as a normal service on any computer. Then just write the script as
> you would any other computer program, launch it once and it will run
> forever. If you want a reminder, just have it keep a list of dates (in
> an array, or XML, or a database, or anything else) and it can send a
> message to standard output when you need the reminder, or, better, it
> can send you an email.


Firstly thanks to everyone who has responded.

How would I go about turning a PHP5 script into a daemon? This sounds like
it could be the solution I need?

Regards

Hamilton



Reply With Quote
  #8 (permalink)  
Old 11-16-2004
lawrence
 
Posts: n/a
Default Re: How do you make a script run automatically?

"Spidah" <h.laughland@eggstra.co.nz> wrote in message
> Firstly thanks to everyone who has responded.
>
> How would I go about turning a PHP5 script into a daemon? This sounds like
> it could be the solution I need?


Sams (the publisher) I think has a new book out on PHP 5 which has a
good chapter on running PHP 5 as a daemon. I read most of it the last
time I was in a Barnes and Noble bookstore (I'm in America right now).

There should also be documentation on the www.php.net site, but I
haven't found it. Haven't looked much either.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:01 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0