You are here: Re: Run PHP file as cronjob « PHP Programming Language « IT news, forums, messages
Re: Run PHP file as cronjob

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация