Re: Running a PHP script automatically?
| From: | Chris Shiflett | Date: | Sun, 22 Sep 2002 05:23:58 +0000 |
| Subject: | Re: Running a PHP script automatically? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117150@lists.php.net to get a copy of this message | ||
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
Make sure it is executable (chmod 755 script.php, for example), and execute it:
./script.php
With cron, just call the script using the full path, and you're all set.
Happy hacking.
Chris
Joseph Szobody wrote:
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?