Hi,
Sunday, September 22, 2002, 2:44:54 PM, you wrote:
JS Folks, I have a PHP script that needs to be executed automatically every 15
minutes. I have the option of doing this on a RedHat linux box, or on Windows 2000
Server.
JS How would I do this (on either platform) and which would be
- Original Message -
From: Tom Rogers [EMAIL PROTECTED]
To: Joseph Szobody [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 12:02 AM
Subject: Re: [PHP] Running a PHP script automatically?
Hi,
Sunday, September 22, 2002, 2:44:54 PM, you wrote:
JS Folks, I have a PHP
: [PHP] Running a PHP script automatically?
This is what your are looking for. It works great.
I think this article assumes Linux which is what I use anyway. I guess
that
if you were to use windows you could schedule the task but you would need
to
call it using
c:\pathTOphp\php.exe c
On the Linux box compile PHP as CGI (i.e. don't configure it as an apache
mod). Then you can just run your script from the the command-line.
This is called CLI (Command Line Interface), not CGI (Common Gateway
Interface). The CGI is called from an WebServer; CLI get's called from a
Folks, I have a PHP script that needs to be executed automatically every 15 minutes. I
have the option of doing this on a RedHat linux box, or on Windows 2000 Server.
How would I do this (on either platform) and which would be easier?
I believe somehow I could create a cron job on linux, but
Joseph,
The easiest way, in my opinion, is to make your PHP script into a shell
script or to call it with PHP yourself. A Red Hat Linux box is going to
have a command line PHP located somewhere like /usr/bin/php. So, make
the first line of your PHP script something like this:
#! /usr/bin/php
On the Linux box compile PHP as CGI (i.e. don't configure it as an apache
mod). Then you can just run your script from the the command-line.
For example:
#!/usr/local/bin/php -q
?php
print Hello world.\n;
?
The -q suppresses the html crap that gets spit out. I don't know jack
about Redhat
7 matches
Mail list logo