473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
Jul 17 '05 #1
7 2288
.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
Jul 17 '05 #2
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
Jul 17 '05 #3
Ed Jones <ho*************@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

Jul 17 '05 #4
"Spidah" <h.*********@eggstra.co.nz> wrote in message news:<OJ*******************@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.
Jul 17 '05 #5
Daniel Tryba wrote:
Ed Jones <ho*************@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
Jul 17 '05 #6

"lawrence" <lk******@geocities.com> wrote in message
news:da*************************@posting.google.co m...
"Spidah" <h.*********@eggstra.co.nz> wrote in message
news:<OJ*******************@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

Jul 17 '05 #7
"Spidah" <h.*********@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.
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: LRW | last post by:
Sorry to crosspost, but I have no idea if this is more a PHP question of general Linux question. I have a script that makes changes to image files, montages them into a jpg, and creates a Web...
5
by: Tim Morrison | last post by:
Is there any easy way to create a change script as illustrated below for all tables within a database? Right now I would have to create a seperate script for each table. I would like to be able...
2
by: Dennis | last post by:
This may be easy for most but I can't get this thing to work. I believe I followed all the instructions but when I click on the link no window opens just the default IE page cannot display. Here is...
2
by: Efrat Regev | last post by:
Hello, I'm a data-structures course TA trying to write a python CGI script for automatically compiling and testing students' projects. Unfortunately, I've run into some questions while writing...
7
by: Wladimir Borsov | last post by:
I want to call a perl script myscript.pl in my cgi-bin from a HTML web page. This call should NOT use SSI (because in this case HTTPS://.... protocol is necessary). Furthermore NO button click...
11
by: Gregor Kovač | last post by:
Hi! I have an SQL script with bunch of CREATE TABLES, ALTER TABLES, ... I'd like it to run transactially. I have found that id I run a ALTER STATEMENT inside a transaction and then roll it back...
1
by: fortwilliam | last post by:
I have a newsletter system and want to have it work automatically. what I have so far works with a visitor to a page with a tiny iframe in it. This iframe calls up the send.pl newsletter script....
14
by: asdf | last post by:
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.