Posted by Tommy Gildseth on 06/21/06 20:04
Mossum wrote:
> Hello,
>
> I have a PHP file that reads another PHP file and writes it as a static
> HTML page. I'd like to run the first PHP file as a cronjob (so that the
> static HTML page is updated once an hour).
>
> I'm familiar with scheduling a cronjob and all the PHP is working
> perfectly. I don't know how to get cron to "run" a PHP file however.
> Any advice would be greatly appreciated.
>
Alt 1:
If you have the CLI version of PHP installed, simply write
@hourly /path/to/php/interpreter/php /path/to/php/script.php
Alt 2:
Use wget/lynx/curl etc etc to fetch the file via the webserver. You can
then either echo the content out, and have wget/...etc save it to
wherever you want it, or you can still do this in the PHP-script, and
don't return any content to wget
--
Tommy Gildseth
http://design.twobarks.com/
[Back to original message]
|