RE: [PHP] PHP and Cron
| From: | Rodino, Justin Bain | Date: | Thu, 14 Sep 2000 19:09:42 +0000 |
| Subject: | RE: [PHP] PHP and Cron | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16819@lists.php.net to get a copy of this message | ||
All you need to do is simply use the executable before the php file in the
cron job. I have a bunch of php scripts running via cron:
* * * * * /usr/local/bin/php
/commonwww/htdocs/wndu/admin/maint/matchup_poll_results.php > /dev/null
* * * * * /usr/local/bin/php
/commonwww/htdocs/wndu/admin/flights/spirit_poll_results.php > /dev/null
etc...
________________________________________
Justin Rodino <justin@goldendome.com>
Web Application Developer
Golden Dome Media
PO Box 1616
Notre Dame, IN 46634
219.631.1116
800.728.7979 ext. 1116
219.631.1001 - fax
http://www.wndu.com/
> -----Original Message-----
> From: kot@shop.symbol.ru [mailto:kot@shop.symbol.ru]On Behalf
> Of Max Derkachev
> Sent: Thursday, September 14, 2000 11:55 AM
> To: Jason Murray
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] PHP and Cron
>
>
> Shouldn't you try to write
> #!/usr/local/bin/php -q
> at the VERY FIRST line in your php script, then chmod it u+x
> and execute it?
> It's so simple.
> Those #!.. things aren't perlish or something. It's your
> system judges what
> program this script to execute with.
> Well, if it's not acceptable, you can even write a line in crontab:
> 00 01 **** /usr/local/bin/php -q script.php
> If you do so, there is no need in placing
> #!/usr/local/bin/php -q instruction
> in your script.
> The script does not even need to have executable bit.
>
> Example:
> script.php:
> .........
> #!/usr/local/bin/php -q
> <?php
> echo "it works\n";
> ?>
> .....
> chmod u+x script.php
> ./script.php
> it works
>
>
>
> > Adam Charnock wrote:
> > >
> > > Hi all. I have written a PHP script that needs to be run
> as a cron job.
> > > However, since it does not have a line such as this I am
> told it will not
> > > work:
> > > #!/usr/bin/perl
> > >
> > > Has anyone else managed a work around for this problem or
> is there a good
> > > solution to it?
> > >
> > > Thanks
> > > Adam Charnock
>
> --
> Best regards,
> Max A. Derkachev mailto:kot@books.ru
> Symbol-Plus Publishing Ltd.
> phone: +7 (812) 265-0054, 265-1228, phone/fax: 567-8775
> http://www.Books.Ru -- All Books of Russia
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>