Re: Best way to start a CRON
| From: | John Nichel | Date: | Thu, 20 Apr 2006 12:56:11 +0000 |
| Subject: | Re: Best way to start a CRON | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234372@lists.php.net to get a copy of this message | ||
Pure Web Solution wrote:
I run several PHP scripts via CRON in the following way: put the following in the top of the php script: #!/usr/local/bin/php -q (linux system - location of php bin)^^^^^^^ If you're going to use this....
and in the CRONTAB I have the following: 10 1 * * * root /usr/local/bin/php -q /script/CRONexport.phpThere's no need to repeat it here ^^^ (make the script executable)
the -q supress HTML headers._HTTP_ headers. This is only necessary if you're running an older version. The CLI (since 4.2 I think) automatically does this. http://www.php.net/manual/en/features.commandline.php -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 jnichel@dotcomholdingsofbuffalo.com