Re: Can php auto execute it's script in schedule without opening a webpage?
| From: | Chris Shiflett | Date: | Mon, 16 Dec 2002 05:44:58 +0000 |
| Subject: | Re: Can php auto execute it's script in schedule without opening a webpage? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128370@lists.php.net to get a copy of this message | ||
--- Jack <nedcor4@nedcor.com.hk> wrote:
> i want to set a schedule for php to run certain
> script at specify time, to what i understood in
> php is : the script can only be process when a
> homepage had been execute. but i want the script
> to be excute even no one open a homepage contain
> php script in it!
>
> is there anyway i can do that?
Sure, though it varies depending on your platform.
Assuming you are on Unix, it is likely that you already
have a CLI (command line interface) PHP installed
somewhere. You can use this to create a PHP script that can
be executed like any other shell script. Just put something
like this at the top:
#! /usr/bin/php -q
Be sure it points to the location of your PHP parser
(/usr/bin/php in this example).
To automate scripts, look into cron:
man cron
man crontab
Good luck.
Chris